Currently, I am researching visible light (Li-Fi) using camera2 API on Android Studio.
However, auto-exposure and auto-focus can get in the way when taking pictures of LEDs and retrieving data.
·Automatic exposure
·Autofocus
Please tell me how to cut the above two.
specifications
Android Studio 3.1
Smartphone
SHARP AQUOS API 23
HUAWEIP10 API24
The capture
method in CameraCaptureSession
takes CameraRequest
as the argument.Yes.CameraRequest
has various fields, CONTROL_AF_MODE
and CONTROL_AE_MODE
for autofocus and autofocus.If you set them to OFF
, they will be disabled.It also offers CONTROL_MODE
that allows you to configure three things together, including white balance adjustments.
createCaptureRequest
in CameraDevice
allows you to generate CameraRequest.Builder
appropriate for each camera, so you should rewrite it to disable AF etc.
Quote Google's sample code (comments made by the citation):
val captureRequest=session.device.createCaptureRequest(
CameraDevice.TEMPLATE_STILL_CAPTURE).apply {addTarget(imageReader.surface)}
// CaptureRequest.set(CONTROL_AF_MODE, OFF) and so on.
session.capture(captureRequest.build(), object: CameraCaptureSession.CaptureCallback(){
...
340 Memory layouts learned in theory don't work out as expected when actually printed as addresses.
366 To Limit Column Values to Strings in a String List Using sqlalchemy
356 Unity Virtual Stick Does Not Return to Center When You Release Your Finger
356 I want to create an array of sequences from "1" to a specified number.
© 2023 OneMinuteCode. All rights reserved.