The comparison is simple: I take a photo with my Custom camera which uses CameraManager. Then I take the same photo with the default Galaxy Note 5 camera. The largest size available for the CameraManager is 3264 by 1836
so I use that and set the Samsung camera to that same resolution as well. The results
Then I try setting the CameraManager photos with
captureBuilder.set(CaptureRequest.JPEG_QUALITY, (byte) 100);
Still no change. Well only one change: the file size of the photo taken with CameraManager becomes 2.3MB (it used to be 0.5MB) while the size of the Samsung photo (remains) 1.6MB. So even with the larger size, the photo taken with CameraManager is still of lower quality. Any ideas how I might fix this problem: How do I make the photo taken with CameraManager have the same quality as the one taken with the default Camera app that comes with the Note 5?
One-Tap Image Enhancer Fotor's powerful image enhancer can help you improve your photo quality with only one click. Just upload your image and click “1-Tap Enhance” button, and Fotor will automatically detect and correct the lightings and color, improve details, and repair blurry for your photo in real time.
These are some methods when we working on Camer manager,this method may help you.
The Android Camera application encodes the photo in the Intent delivered to onActivityResult() as a small Bitmap in the extras, under the key "data". The following code retrieves this image and displays it in an ImageView.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
mImageView.setImageBitmap(imageBitmap);
}
}
private File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
// Save a file: path for use with ACTION_VIEW intents
mCurrentPhotoPath = "file:" + image.getAbsolutePath();
return image;
}
private void setPic() {
// Get the dimensions of the View
int targetW = mImageView.getWidth();
int targetH = mImageView.getHeight();
// Get the dimensions of the bitmap
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);
int photoW = bmOptions.outWidth;
int photoH = bmOptions.outHeight;
// Determine how much to scale down the image
int scaleFactor = Math.min(photoW/targetW, photoH/targetH);
// Decode the image file into a Bitmap sized to fill the View
bmOptions.inJustDecodeBounds = false;
bmOptions.inSampleSize = scaleFactor;
bmOptions.inPurgeable = true;
Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);
mImageView.setImageBitmap(bitmap);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With