I am considering using photos taken with a smartphone for practical measurements, such as in Structure-from-Motion (SFM). To use them for measurements, information such as the focal length, image sensor size, and pixel count is essential. However, when using the setZoomRatio function to zoom in or out while taking photos, the configured zoomRatio is reflected in the picture, causing it to be enlarged or reduced. Unfortunately, this change is not reflected in the Exif data's focal length.
Moreover, in cases where multiple cameras are present, as in the Pixel 7a, changing the zoomRatio from 1.0 to 0.99 not only alters the focal length but also significantly affects the image size. Additionally, when examining CameraID and PhysicalCameraID on a Pixel 7a, it is evident that there are multiple sensors, making it necessary to know which sensor was used.
To accurately extract focal length and sensor information from photos taken, what steps should be taken?
Thanks,
The specifications for the Pixel 7a are as follows:
CameraId = 0
facing = 1(facingFront = 0, facingBack = 1)
isLogicalCamera = true
focal length = 5.43
sensor size = 7.3984x5.5552
pixel size = 4624x3472
physical CameraID = 2
focal length = 5.43
sensor size = 7.3984x5.5552
pixel size = 4624x3472
physical CameraID = 3
focal length = 1.835
sensor size = 4.71296x3.4944
pixel size = 4208x3120
physical CameraID = 4
focal length = 5.43
sensor size = 3.6992x2.7776
pixel size = 4624x3472
CameraId = 1
facing = 0(facingFront = 0, facingBack = 1)
isLogicalCamera = false
focal length = 2.74
sensor size = 4.71296x3.44064
pixel size = 4208x3072
--
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/8b0bc16f-16e2-49be-902b-81c4a74fc3b9n%40android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/CAB8xOM9JUBV4A7FKGFLsvooSGmeDvX9JAUy%3DrKvcaiOyzCo_WQ%40mail.gmail.com.
Eddy-san, Kailiang-san,
Thank you for your response.
Thank you for providing information on obtaining camera orientation, position, and intrinsics. This information is very valuable to me as it is crucial for performing SFM and similar tasks.
As a beginner in Kotlin, Android Studio, CameraX, and Camera2, I was unsure how to use Camera2Interop from CameraX, so I tried various things using the Android Camera2Basic Sample. It took me quite some time to get Camera2Basic running, so I apologize for the delayed response.
By modifying the source code of Camera2Basic, I was able to obtain the following data from the Pixel 7a:
cameraId = 0
orientation = Back
SENSOR_INFO_PIXEL_ARRAY_SIZE = 4624x3472
SENSOR_INFO_PHYSICAL_SIZE = 7.3984x5.5552
focalLengths = 5.43
physicalCameraID = 2
orientation = Back
SENSOR_INFO_PIXEL_ARRAY_SIZE = 4624x3472
SENSOR_INFO_PHYSICAL_SIZE = 7.3984x5.5552
focalLengths = 5.43
physicalCameraID = 3
orientation = Back
SENSOR_INFO_PIXEL_ARRAY_SIZE = 4208x3120
SENSOR_INFO_PHYSICAL_SIZE = 4.71296x3.4944
focalLengths = 1.835
physicalCameraID = 4
orientation = Back
SENSOR_INFO_PIXEL_ARRAY_SIZE = 4624x3472
SENSOR_INFO_PHYSICAL_SIZE = 3.6992x2.7776
focalLengths = 5.43
cameraId = 1
orientation = Front
SENSOR_INFO_PIXEL_ARRAY_SIZE = 4208x3072
SENSOR_INFO_PHYSICAL_SIZE = 4.71296x3.44064
focalLengths = 2.74
Min zoom: 0.5304938, Max zoom: 8.0
Next, by changing the value of CaptureRequest.CONTROL_ZOOM_RATIO
, I conducted a parameter study and obtained the results shown in the attached Excel file.
I found that the switching between physicalCameraID=3
and 2
occurs at CONTROL_ZOOM_RATIO=1
, and physicalCameraID=2
and 4
switch at CONTROL_ZOOM_RATIO=2
. As the zoom ratio of the captured photos increases, the images are continuously enlarged, but the intrinsics do not follow suit.
Therefore, I have the following questions:
CONTROL_ZOOM_RATIO=1
, where physicalCameraID=3
and 2
switch, the switch occurs discontinuously. I think the intrinsics need to be adjusted for use in SFM. How should I modify them?physicalCameraID
s?SENSOR_INFO_PIXEL_ARRAY_SIZE
for physicalCameraID=3
is 4208x3120, but why does the captured image have a size of 4624x3472?physicalCameraID=4
has the same focal length as physicalCameraID=2
, and the SENSOR_INFO_PHYSICAL_SIZE
is half that of physicalCameraID=2
, yet the intrinsics are similar to those of physicalCameraID=2
. It seems that physicalCameraID=2
and 4
are using the same sensor image. Why are they separated like this?By the way, when I tried with the SHARP sense5g, which has three lenses, I could retrieve neither physicalCamera
nor intrinsics
.
To Kailiang-san, I would be delighted if CameraX had APIs that allow me to obtain camera orientation
, position
, intrinsics
, and lens distiotion, with the zoom ratio reflected.
Also, I have another question. I've been attempting to set the white balance manually, using Pixel7a and setting CaptureResult.CONTROL_AWB_MODE to CONTROL_AWB_MODE_OFF, CONTROL_AWB_MODE_FLUORESCENT, and CONTROL_AWB_MODE_SHADE.
As a result, when CONTROL_ZOOM_RATIO is set to 1, CaptureResult.CONTROL_AWB_MODE remains CaptureResult.CONTROL_AWB_MODE_AUTO and does not change. However, when CONTROL_ZOOM_RATIO is set to values other than 1, such as 0.6, 0.9, 1.001, 2, 3, or 8, CaptureResult.CONTROL_AWB_MODE becomes the value specified in CaptureRequest.CONTROL_AWB_MODE.
Is there anything else I need to do when CONTROL_ZOOM_RATIO is set to 1?
I apologize for the lengthy text. Thank you.
Regards,
Masa,
--
You received this message because you are subscribed to a topic in the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this topic, visit https://groups.google.com/a/android.com/d/topic/camerax-developers/HR6D7OR7jzU/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJy3%2Bk_EGQWpzuuW6CJWLZYPP53ntG_ULdHHo2%3D3HC5YfyhR7w%40mail.gmail.com.