Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

What will be the best settings for capturing clear face images through cameraX?

65 views
Skip to first unread message
Assigned to scot...@google.com by me

Mandar Kulkarni

unread,
Nov 13, 2024, 4:37:59 AM11/13/24
to Android CameraX Discussion Group
Hi,

I'm working on an android app which takes face photo and scans it for skin issues, I have been using cameraX for that but I'm getting lot of cases where photos are coming blur and it's difficult to analyse those images so wanted to know what will be the proper configurations for capturing sharp images?

My previous implementation used to use  setTargetResolution function to set resolution but since it's deprecated, I'm moving to resolutionSelector strategy so will this give any benefit in photo quality? Any suggestions on improving the photo quality are highly appreciated

Eino-Ville Talvala

unread,
Nov 13, 2024, 4:46:26 PM11/13/24
to Mandar Kulkarni, Android CameraX Discussion Group
Hi,

The question is, when you say 'blur' what kind of image problem is it?  Is the focus poor, or is the person moving too fast (motion blur)? Or is the image too dark so it's noisy?
Or too low resolution? People use 'blur' in many ways, and advice will depend on what kind of specific problem you're seeing.



--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/a474e50c-7637-4926-b3d9-0840c43cbe9an%40android.com.

Mandar Kulkarni

unread,
Nov 14, 2024, 12:12:14 AM11/14/24
to Android CameraX Discussion Group, etal...@google.com, Android CameraX Discussion Group, Mandar Kulkarni
Hi,

Mostly it's blur because of 2 reasons:
1. Focus not proper
2. Image is too dark

Ashley M

unread,
Nov 14, 2024, 8:40:16 AM11/14/24
to Mandar Kulkarni, Android CameraX Discussion Group, etal...@google.com

The focus is blurry n the picture is not a good caption n is very blurry. Thanks for replying back to me.


On Wed, Nov 13, 2024, 11:12 p.m. Mandar Kulkarni <mkman...@gmail.com> wrote:
Hi,

Mostly it's blur because of 2 reasons:
1. Focus not proper
2. Image is too dark

On Thursday 14 November 2024 at 03:16:26 UTC+5:30 etal...@google.com wrote:
Hi,

The question is, when you say 'blur' what kind of image problem is it?  Is the focus poor, or is the person moving too fast (motion blur)? Or is the image too dark so it's noisy?
Or too low resolution? People use 'blur' in many ways, and advice will depend on what kind of specific problem you're seeing.



On Wed, Nov 13, 2024 at 1:38 AM Mandar Kulkarni <mkman...@gmail.com> wrote:
Hi,

I'm working on an android app which takes face photo and scans it for skin issues, I have been using cameraX for that but I'm getting lot of cases where photos are coming blur and it's difficult to analyse those images so wanted to know what will be the proper configurations for capturing sharp images?

My previous implementation used to use  setTargetResolution function to set resolution but since it's deprecated, I'm moving to resolutionSelector strategy so will this give any benefit in photo quality? Any suggestions on improving the photo quality are highly appreciated

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/a474e50c-7637-4926-b3d9-0840c43cbe9an%40android.com.

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.

Scott Nien

unread,
Nov 14, 2024, 9:48:26 AM11/14/24
to Ashley M, Mandar Kulkarni, Android CameraX Discussion Group, etal...@google.com
>My previous implementation used to use  setTargetResolution function to set resolution but since it's deprecated, I'm moving to resolutionSelector strategy so will this give any benefit in photo quality? Any suggestions on improving the photo quality are highly appreciated

Both resolutionSelector and setTargetResolutions determine the image resolution, which is possible to get "blurred" if the size is too small. 

Please note that the size you set via setTargetResolution is related to the setTargetRotation you set in the builder. For example, on a phone device,  if you set targetRotation to SURFACE_0 (or display orientation is SURFACE_0 when you invoke bindToLifecycle), the size you set must be a "tall" resolution (height > width).  If you set it wrong, such as setting a "wide" resolution , then you could get a smaller size than you expected.  ResolutionSelector doesn't have this kind of behavior so we recommend you using ResolutionSelector if possible. 

If the problem is the "focus not proper" problem,  I suggest that you can perform a cameraControl.startFocusAndMetering() on the center point before taking a picture. 
See sample codes below:
MeteringPoint pt= (new SurfaceOrientedMeteringPointFactory(1.0f, 1.0f))
            .createPoint(0.5f, 0.5f);
mCamera.getCameraControl().startFocusAndMetering(
new FocusMeteringAction.Builder(pt)
.build()
).addListener(() -> {
imageCapture.takePicture(... new OnImageSavedCallback()
@Override
public void onImageSaved(
@NonNull ImageCapture.OutputFileResults outputFileResults) {

mCamera.getCameraControl().cancelFocusAndMetering();
}

@Override
public void onError(
@NonNull ImageCaptureException exception) {
mCamera.getCameraControl().cancelFocusAndMetering();
}
}



Ashley M

unread,
Nov 14, 2024, 9:55:19 AM11/14/24
to Scott Nien, Mandar Kulkarni, Android CameraX Discussion Group, etal...@google.com

Thank you!

Reply all
Reply to author
Forward
0 new messages