Question

My team is developing an app for HTC phones that uses the stereo camera. In order to do our processing, we require the still images taken by the 3D camera to be in MPO format. By default it is returning JPS images.

How can I make the camera return MPO images? Is there someplace that this is documented?

I have spent a while on HTCs site but was unable to find source code for their API or camera app that might help (since their camera app can do MPO files).

Was it helpful?

Solution

I don't know an API for this, but it is pretty straight forward to do yourself. The JPS format is just a single image with the left half being one camera and the right half being another. So first step just convert it to two separate images. Create new bitmaps from it with rectangles for either side:
http://developer.android.com/reference/android/graphics/Bitmap.html#createBitmap(android.graphics.Bitmap,%20int,%20int,%20int,%20int,%20android.graphics.Matrix,%20boolean)

The MPO format is just two JPG images in one file, one after the other. So next write two JPG images using the compress method to the same file output stream:
http://developer.android.com/reference/android/graphics/Bitmap.html#compress(android.graphics.Bitmap.CompressFormat,%20int,%20java.io.OutputStream)

You can find a lot of sample code online for Android for cropping images and saving them to JPG, which is pretty much all you need.

OTHER TIPS

The MPO format is not just

two JPG images in one file, one after the other.

http://www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-007_E.pdf English translation of the 2009-02-04 standard of the Camera and Image Processing Association's Standard Development Working Group, Multi-Picture Format Sub-Working Group.

https://www.htcdev.com/devcenter/opensense-sdk/stereoscopic-3d/s3d-sample-code/ Shows some sample code for working with the HTC EVO 3D camera.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top