Android camera2 API intrinsics and the DEPTH_OUTPUT capability - android

Extracting intrinsic calibration parameters from an android device's camera using the camera2 API is known to be problematic.
However the guidance has been that if the phone supports the DEPTH_OUTPUT capability, it is guaranteed to also provide camera intrinsics (via LENS_INTRINSIC_CALIBRATION).
This is stated in the following sources:
In this SO answer
In the documentation, where it is stated that:
[The DEPTH_OUTPUT] capability requires the camera device to support the following:
This camera device, and all camera devices with the same android.lens.facing, will list the following calibration metadata entries in both CameraCharacteristics and CaptureResult:
android.lens.intrinsicCalibration
Still, the Huawei P30 Pro claims to support the DEPTH_OUTPUT capability but does not provide any useful intrinsics (all intrinsic parameters are zero).
For what it's worth, the Huawei P30 Pro's support for the camera2 API is INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED, but this should not matter, as neither of the sources cited above give any conditions on the device's camera2 API support level for extracting intrinsics.
Could anyone please help?

Related

CameraCharacteristics SENSOR_INFO_EXPOSURE_TIME_RANGE gives wrong values

I am using SENSOR_INFO_EXPOSURE_TIME_RANGE to calculate the range of supported exposure time.
I tested this in Huawei P30 Pro and it seems like this API is giving wrong values(10000 - 1000000000).
But when I use the built in camera app's pro mode, there I can set exposure value to 30s which is really larger than what is provided by the API.
Can anyone help me with this? How to get correct values for the range of supported exposure durations?
As Camera algorithms are defined differently on different phone models and manufactures, for Huawei Mate30 Pro, please use HMS camera kit API to get the calculated exposure range instead of using Android Camera2 native API:API example is as follows, then you will see the exposure range returned as : 1/4000-30s.
mMode.getModeCharacteristics()
.getParameterRange(RequestKey.HW_PRO_SENSOR_EXPOSURE_TIME_VALUE)
For more detailed info. on how to integrate HMS camera Pro. Mode, please refer to HMS Camera Engine Developer’s Guide:
Please note: HMS Camera Engine SDK is currently only available on HMS phones.

Camera API 1 and Camera API 2 return different sensor orientation info

I am trying to figure out the limitations of using camera2 with devices that have hardware level support LEGACY. From the official docs for android camera2 api:
LEGACY: These devices expose capabilities to apps through the Camera API2 interfaces that are approximately the same capabilities as those exposed to apps through the Camera API1 interfaces. The legacy frameworks code conceptually translates Camera API2 calls into Camera API1 calls; legacy devices do not support Camera API2 features such as per-frame controls.
I have found this to be false... In fact I expected that sensor orientation obtained through Camera.CameraInfo camInfo -> camInfo.orientation (docs) would be the same as cameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION) (docs)
However it is not the case!
Camera API 1 returns an orientation angle of 90°
Camera API 2 returns an orientation angle of 270°
Notice that this is quite different! Landscape orientation != inverse landscape orientation! For example it would completely break the Matrix transformation from the screen preview coordinates to the camera sensor space.
Am I missing something? Is this intended behaviour?
I am using a Xiaomi Redmi 5 plus with Android 8.1 (is this a manufacturer issue?)
Thanks
If the two queries apply to the same camera, this is definitely a bug, and Xiaomi is responsible. Bugs do happen even on mainstream devices, and the camera API adaptation layers tend to be more buggy than other APIs.
You may find that for LEGACY devices, camera2 layer introduces extra overhead, and vice versa. You get best performance if you work trhough the deprecated Camera API for LEGACY devices, and through the camera2 API for other devices. I know it's painful to support two versions of your code, but when you need to utilize the device in the best way, you have to pay this price.

Is it possible to access external usb camera using deprecated api android.hardware.Camera

Is it possible to access external usb camera using deprecated api android.hardware.Camera? Also is it possible in new Camera2 api? Then how to use since I'm new to camera functionality
The Camera and Camera2 APIs are for interfacing with the built in hardware camera only. Depending on what USB camera you are trying to control, there may already be a library/SDK for you to use but Camera and Camera2 will not work for your use case.
To add to Eric Bachhuber's comment:
On a few Android devices, there's support for external USB cameras through the standard camera APIs, but this is not a standard feature.

what is difference between normal android device and tango device in terms of sensors?

I wanted to ask the features that tango devices have and normal android device (SAMSUNG GT-19505) don't have.
I am confused with the camera that tango have and normal android device like (SAMSUNG GT-19505) have.If i use SAMSUNG GT-19505 with tango API which capabilities of library will i be able to leverage.
Google Project Tango has two special cameras and two emitters on the back face:
A fish-eye RGB camera for wide-angle video.
A Class-1 IR-laser emitter for highlighting surface points.
An IR camera for detecting said points (and thereby determining spatial position.)
A flash for low-light conditions. (Might perhaps also be useful for assisting mapping efforts in low-light situations.)
Like most modern phones, the Samsung GT-19505 has an RGB camera, and a flash, but lacks the emitter/receiver pair for 3D depth-sensing and area-mapping, rendering the Project Tango SDKs incompatible.

Is there a way to check the camera HAL version from a Java application?

Is there a way to check the camera HAL version from a Java application?
This is to verify that the camera2 api and HAL3 api is supported. Slide 38 http://www.slideshare.net/lbk003/an-devcon2013-camera3kaurfinal
You shouldn't need to know the exact HAL version of the device, and instead query the camera's capabilities through the camera API.
For the new camera2 API, look at the CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL and REQUEST_AVAILABLE_CAPABILITIES fields to check whether the device has full-capability support or some lesser set of features.

Categories

Resources