How to increase the quality of captured image using Camera 2 API Android?

半城伤御伤魂 提交于 2020-01-24 04:36:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!