HTC One M8 - making use of 2nd rear camera

寵の児 提交于 2019-12-02 21:39:14

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/28216291/htc-one-m8-making-use-of-2nd-rear-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!