How to split left and right camera images (HTC Evo 3D) in camera preview data

Now I have a HTC Evo 3D with two rear cameras, and you plan to do some stereo-perspective experiments. I accessed the stereo camera using the following code:

private final static int CAMERA_STEREOSCOPIC = Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH ? 2 : 100; camera = Camera.open(CAMERA_STEREOSCOPIC); 

To access camera preview data:

 bufferSize = mPreviewWidth * mPreviewHeight * bitsPerPixel / 8; mPreviewBuffer = null; // New preview buffer. mPreviewBuffer = new byte[bufferSize + 4096]; // with buffer requires addbuffer. camera.addCallbackBuffer(mPreviewBuffer); camera.setPreviewCallbackWithBuffer(mCameraCallback); private final Camera.PreviewCallback mCameraCallback = new Camera.PreviewCallback() { public void onPreviewFrame(byte[] data, Camera c) { // to do the camera image split processing using "data" } }; 

But what is the size and structure of the preview data here and how can I separate the left and right camera image in the camera preview code?

By the way, should I pay attention to the size of the preview data buffer for two cameras?

Any ideas? Thanks in advance!

+4
source share

Source: https://habr.com/ru/post/1440685/


All Articles