问题
I am creating Android camera app using google sample. After the phone captures an image there is a difference of image quality. The camera preview has better image quality than the output image. How can I increase the quality of output image? After pinch zoom the difference of quality of preview image and output image even increases. This is my photo fragment and it's base class.
回答1:
The only way you have to increase your image quality is increasing your ImageReaderSize to a biggest resolution:
mImageReader = ImageReader.newInstance(pictureSizeValue.getWidth(), pictureSizeValue.getHeight(), format, maxImages);
Also, you can improve the quality using the key CaptureRequest.JPEG_QUALITY
in your CaptureRequest
.
mCaptureRequestBuilder.set(CaptureRequest.JPEG_QUALITY, (byte) 100);
But, to be honest, the difference between 91-100 of JPEG_QUALITY
values are minimal, and you will get a bigger image in the process. You can check the curve between quality-size here:
hope that it will help you!
来源:https://stackoverflow.com/questions/41797596/how-to-increase-the-quality-of-captured-image-using-camera-2-api-android