jeudi 29 janvier 2015

[Q] Using both rear cameras in M8 topic






I have an HTC One M8 device, which as you know 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:


Code:


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:


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?






Aucun commentaire:

Enregistrer un commentaire