1

Can i proccess raw RGB camera data in an Android device without using NDK+opencv? I don't even need to change the displayed data, only to get information from it.

Edward Falk
  • 9,991
  • 11
  • 77
  • 112
  • What have you tried so far? You can get get a still image from the camera. What information do you need/want? – Fildor Sep 23 '12 at 11:42
  • Check this answer : http://stackoverflow.com/questions/10775942/android-sdk-get-raw-preview-camera-image-without-displaying-it – Eli Turchinsky Sep 23 '12 at 11:44

1 Answers1

0

As far as I remember, the image data comes in NV21-format from your byte[] data

Code taken from https://developer.android.com/guide/topics/media/camera.html (onPictureTaken from PictureCallback(), but similar to onPreviewFrame(byte[] data, Camera camera) from Camera.PreviewCallback.

private PictureCallback mPicture = new PictureCallback() {

    @Override
    public void onPictureTaken(byte[] data, Camera camera) {
        //convert here and do other stuff like save the picture.
    }
};

In both cases you have to convert from NV21 to RGB in said methods, that you could implement like this: Confusion on YUV NV21 conversion to RGB

Community
  • 1
  • 1
sschrass
  • 7,014
  • 6
  • 43
  • 62