Getting raw image data in android

asked 2013-08-12 03:33:47 -0500

ezfn gravatar image

updated 2013-08-12 15:58:47 -0500

Hi, I have been trying to get raw image data from the camera on Android. By raw I mean, before it went through Bayer filtering and interpolation. Sadly, The standard Android camera API, doesn't support this need:

I tried

public final void takePicture (Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback postview, Camera.PictureCallback jpeg)

But, as seen in many other forums, the raw data returned to the "raw" callback is always null.

What I would like to have:

  1. [ideally] is a video stream of raw frames before any kind of manipulation.
  2. Less ideally, I can do with still images of the same kind.
  3. I can also benefit from capturing the frames after Bayer filtering, but before interpolation.

Note - I have also tried this:

Camera.Parameters parameters=preview.camera.getParameters();
parameters.set("rawsave-mode", "1");
parameters.set("rawfname", "/mnt/sdcard/test.raw");
preview.camera.setParameters(parameters);
preview.camera.takePicture(shutterCallback, null, jpegCallback);

But sadly it doesn't work with My Samsung Galaxy S2 and S4.

How would you go about this kind of task? Do you think it's even feasible within android, or maybe I have to resort to writing some native code?

I have GalaxyS4, BTW.

Thank you very much,

Erez

edit retag flag offensive close merge delete