- 现象:最近在做opencv 轮廓提取,利用Android自定义相机进行文档最大轮廓提取,拍照后画质十分始终十分模糊不清,造成云端识别不精准,查找了很多原因如下:
- 看网上是由于没有设置最佳分辨率,我也设置了1920*1080 ,或者增大分辨率,但是始终十分模糊
- 又分析原因是不是opencv图像处理造成模糊,结果发现不是,我在下面代码出,直接对图像进行保存操作,查看图库相册发现也不是清晰
- 于是我找相机参数,白平衡,曝光等等试了也没有效果,难道是Camera1的限制?
cameraPreview.takePhoto(new Camera.PictureCallback() {
File originalFile = getOriginalFile();
FileOutputStream originalFileOutputStream = new FileOutputStream(originalFile);
originalFileOutputStream.write(data);
originalFileOutputStream.close();
Bitmap bitmap = BitmapFactory.decodeFile(originalFile.getPath());
File noCropFile = getNoCropFile();
BufferedOutputStream bos1 = new BufferedOutputStream(new FileOutputStream(noCropFile));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos1);})
