I have a quick question. I'm using Android's SurfaceView to take a picture and save it. However, the preview size and the picture quality itself is both terrible; as in, it is very blurry. There's no sharpness to the picture quality at all.
Here's where I initialize my surfaceView:
camera.setDisplayOrientation(90);
Parameters parameters = camera.getParameters();
parameters.setWhiteBalance(Camera.Parameters.WHITE_BALANCE_AUTO);
parameters.setExposureCompensation(0);
parameters.setPictureFormat(ImageFormat.JPEG);
parameters.setJpegQuality(100);
Camera.Size picSize = getOptimalPreviewSize(parameters.getSupportedPreviewSizes(),
getResources().getDisplayMetrics().widthPixels,
getResources().getDisplayMetrics().heightPixels);
parameters.setPictureSize(picSize.width, picSize.height);
parameters.setPreviewSize(picSize.width, picSize.height);
camera.setParameters(parameters);
camera.setPreviewDisplay(holder);
camera.startPreview();
The getOptimalPreviewSize() returns the best size available from parameters.getSupportedPreviewSizes(). The size that it returns is 1280x720, the best size that my phone will support. However, the surfaceView is still very blurry. Is there anything obviously wrong that I'm doing, or is there a way to optimize the surfaceView? Thanks.