HTC One M8 - making use of 2nd rear camera

2019-03-04 17:09发布

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?

2条回答
混吃等死
2楼-- · 2019-03-04 18:03

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.

查看更多
冷血范
3楼-- · 2019-03-04 18:05

Wikipedia explains that the second sensor is not a real camera:

The main camera remained relatively unchanged, using an "UltraPixel" image sensor (OmniVision OV4688) composed of pixels that are 2.0 µm in size. The UltraPixel sensor was updated to provide better color accuracy in lit photographs, and the device now includes a dual-tone flash. The main camera is accompanied by a second, 2-megapixel depth of field sensor (OmniVision OV2722) located directly above the main camera as a part of the device's "Duo Camera" system. The sensor analyzes the distance and position of elements within a photo, and generates a depth map, which is embedded within each photo.

Maybe there is some backdoor to access the OV2722 sensor directly, but it won't give you a conventional image anyway.

查看更多
登录 后发表回答