I have an HTC One M8 device, which has 2 rear cameras and an additional front facing camera. My problem is trying to access the 2nd rear camera; I have managed to make an app which runs 2 simultaneous cameras (1 front and 1 rear facing), but the problem is that I cannot access the 2nd rear facing one.
I have tried to access the camera through both openCV and through the android camera2 with following code:
openCV for Android:
CameraBridgeViewBase mOpenCvCameraView2;
mOpenCvCameraView2.setCameraIndex(int value);
where value may be 0 - first rear camera, 1 - front facing camera; 2 - does not work for rear facing (and neither does 100, cause I found it on the HTC page)
normal android code:
CameraManager manager = (CameraManager) getSystemService( Context.CAMERA_SERVICE);
try {
String[] cameraList = manager.getCameraIdList();
Log.i("Number of cameras", Integer.toString(cameraList.length));
} catch (CameraAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
This code will print the number of cameras accessible for the device; however, it tells me that it has only 2.
So, does anyone have an idea what I can do to access the 2nd rear camera please?
In my experience with HTC EVO 3D and as stated in some articles here (e.g Unable to use both cameras of Evo 4G using OpenCV4Android), the option off accessing individually one or the other rear facing camera is not supported. You can get combined image from both cameras (stereoscopic view) but that is it.
Wikipedia explains that the second sensor is not a real camera:
Maybe there is some backdoor to access the OV2722 sensor directly, but it won't give you a conventional image anyway.