Brightness change problem when focusing

165 views
Skip to first unread message

yh c

unread,
Nov 14, 2023, 2:16:59 AM11/14/23
to Android CameraX Discussion Group

Hello, I found a problem. When focusing, camerax does not change the brightness of the photo according to the environment, and then the system camera will change the brightness. My focus code is as follows:

val camera = camera ?: return

val meteringPoint = previewView.meteringPointFactory.createPoint(x,y)
val action = FocusMeteringAction.Builder(meteringPoint) // default AF|AE|AWB
.build()

camera.cameraControl.startFocusAndMetering(action)

The version of camerax is 1.3.0

camerax preview:

企业微信截图_2a6c8fa2-f2b1-470e-8470-4c3db4c5010e.png企业微信截图_99794564-504f-489d-801a-142864ca3c3c.png

system camera preview:

企业微信截图_4699a8e4-b540-49ba-b480-10397d16c0f7.png企业微信截图_b55fbb02-b12d-4507-9f7c-ce3db18818a1.png

yh c

unread,
Nov 14, 2023, 7:18:38 AM11/14/23
to Android CameraX Discussion Group, yh c
It seems that FLAG_AE has no effect. When the light is backlit, the photos taken will be very dark.

T2N1A_B_DT1RXrhCrK.jpgT23lx_BsJv1RXrhCrK.jpg

Scott Nien

unread,
Nov 14, 2023, 11:58:52 PM11/14/23
to yh c, Android CameraX Discussion Group
Thanks for letting us know about the issue.  Can you let us know what device you are using ?

I can see the AE is working on Pixel so this is probably a device issue.  Also where do you get the (x, y) ? 

--
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/5d07ae5d-d716-4819-8752-32876448aee0n%40android.com.

yh c

unread,
Nov 15, 2023, 12:33:36 AM11/15/23
to Android CameraX Discussion Group, scot...@google.com, Android CameraX Discussion Group, yh c

Thank you for your reply

Today I found that AE is normal on OnePlus 7pro (ONEPLUS_GM1910).

AE is invalid on IOQQ-Z8 (VIVO-V2314A) and Huawei nova3 (HUAWEI-PAR-AL00).

The code for (x, y) is as follows:

override fun onSingleTapUp(e: MotionEvent): Boolean {
root.findViewTreeLifecycleOwner()?.lifecycleScope?.launch {
_action.emit(CameraUiAction.Focus(e.x, e.y, previewView))
}

return true
}

Scott Nien

unread,
Nov 15, 2023, 11:41:43 PM11/15/23
to yh c, Android CameraX Discussion Group
Got it.. 

I am thinking maybe the size of the Metering region could affect the result.. 
Can you try using a larger size when creating the point ? 

meteringPointFactory.createPoint(x, y,  size /* 0 to 1f */);
the size is 0.15 by default which means the width / height is 15% of the FOV width/height. 

yh c

unread,
Nov 16, 2023, 1:07:16 AM11/16/23
to Android CameraX Discussion Group, scot...@google.com, Android CameraX Discussion Group, yh c

I tried 0.3f, 0.5f, 0.7f and 0.9f, all to no avail.

I tried Pixel3 and Pixel7 and they work fine. Do you have test phones from Oppo or Huawei? Maybe you can try it on these phones.

Thanks

Scott Nien

unread,
Nov 17, 2023, 4:41:11 AM11/17/23
to yh c, Android CameraX Discussion Group
I tried it on the OPPO REno10 Pro 5G,  and the exposure works well.  
This is likely a device specific issue 

yh c

unread,
Nov 17, 2023, 4:46:46 AM11/17/23
to Android CameraX Discussion Group, scot...@google.com, Android CameraX Discussion Group, yh c
I only found this issue on two devices, which seems difficult to solve.
Thanks

Reply all
Reply to author
Forward
0 new messages