Search code examples
androidmatrixcameraroot

camera matrix original image


As I know, when you using camera it crops some part of image. I mean that the application cuts out that part of the photo that goes beyond the rectangle. Is there any way to get the original image that is full-sized and received directly from the camera's matrix? Root access on my device is available.


Solution

  • I did a small demo years ago:

    https://sourceforge.net/p/javaocr/code/HEAD/tree/trunk/demos/camera-utils/src/main/java/net/sf/javaocr/demos/android/utils/camera/CameraManager.java#l8

    Basic idea is to set up callback, then you raw image data is delivered via byte array ( getPreviewFrame() / onPreviewFrame ) - no root access is necessary.

    Actually, this data comes as mmapped memory buffer directly from adress space of camera app - no root is necessary

    As this byte array does not provide any meta information, you have to get all the params from camera object yourself