How to get current focus area in CameraX?

236 views
Skip to first unread message
Assigned to scot...@google.com by wuj...@google.com

Mohit Shetty

unread,
Sep 15, 2021, 5:26:21 AM9/15/21
to Android CameraX Discussion Group
I want to be able to get the radius and co-ordinates of the point/area CameraX is currently focusing at. Is it possible to do it using an existing library code?

Thanks in advance.

Scott Nien

unread,
Sep 17, 2021, 12:55:46 PM9/17/21
to Mohit Shetty, Android CameraX Discussion Group
MeteringPoint#getSize() represents the percentage (0-> 0%,  1-> 100%)  of the sensor width/height (or crop region width/height if crop region is set). In other words, it is the percentage of the current FOV width/height. 

You can manage to get what you want by the above rule.   


On Wed, Sep 15, 2021 at 5:26 PM Mohit Shetty <shetty...@gmail.com> wrote:
I want to be able to get the radius and co-ordinates of the point/area CameraX is currently focusing at. Is it possible to do it using an existing library code?

Thanks in advance.

--
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 on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/81724f49-5bea-4a36-b1ac-d3b23ca82d03n%40android.com.

Mohit Shetty

unread,
Sep 18, 2021, 4:14:22 PM9/18/21
to Android CameraX Discussion Group, Scott Nien, Android CameraX Discussion Group, Mohit Shetty
Hey Scott,

Thanks a lot for the information. I'll try using what you said as the base and let you know about the results as soon as possible. You have answered to a lot of my queries lately. Thank you for everything :)

Regards,
Mohit

Mohit Shetty

unread,
Sep 23, 2021, 1:25:17 PM9/23/21
to Android CameraX Discussion Group, Scott Nien, Android CameraX Discussion Group, Mohit Shetty
Hey Scott,

This doesn't really solve the issue. Basically I want to be able to view the current focus area when the Camera moves...for example in Google Camera, if I focus somewhere and then try to move the camera away from it, the focus circle sticks to the object. So I am trying to achieve something similar here by getting the current focus co-ordinates and size of the area.

Thanks a lot in advance.

On Friday, 17 September 2021 at 22:25:46 UTC+5:30 Scott Nien wrote:

Eino-Ville Talvala

unread,
Sep 23, 2021, 3:21:40 PM9/23/21
to Mohit Shetty, Android CameraX Discussion Group, Scott Nien
Google Camera App is setting that focus area itself - it has some app-level code to track the scene and update the metering point on its own.

The normal API behavior is simply to have the metering point stay where you set it, relative to the image sensor.  It doesn't follow the scene.



Mohit Shetty

unread,
Sep 24, 2021, 4:48:37 AM9/24/21
to Android CameraX Discussion Group, Eino-Ville Talvala, Android CameraX Discussion Group, Scott Nien, Mohit Shetty
Hey Eino-Ville Talvala,

Oh, thanks a lot for the information 👍

Regards,
Mohit

Reply all
Reply to author
Forward
0 new messages