Android SDK: how to obtain an uncompressed picture?

0 like 0 dislike
28 views
Good day!

Write the application under Android which should receive the image and process it in a special way. In docks read that takePicture of the Camera class as parameters, accepts as a and, in which then transmitted data obtained during shooting (rawCallback and jpegCallback).
As a result of experiments it was found that in the jpegCallback consistently comes ready JPEG file that you can then burn to a flash drive, but in rawCallback comes null. The gugleniya does not help. Option decompress JPEG and work with it is not suitable in many aspects (speed, quality etc.)

Please tell me how to be?

PS. Tested on Google Nexus ONE and HTC Desire.
PSS. I enclose a clipping of the code:
public void TakePicture() { if (m_Camera != null && m_CanDoPhoto) { m_CanDoPhoto = false; m_Camera.takePicture(shutterCallback, rawCallback, jpegCallback); } } PictureCallback rawCallback = new PictureCallback() { public void onPictureTaken(byte[] _data, Camera _camera) { String path = Environment.getExternalStorageDirectory().toString(); File File = new File(path, "MyTestPhoto.raw"); try { FileOutputStream fOut = new FileOutputStream(file); fOut.write(_data); fOut.flush(); fOut.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } }; PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] _data, Camera _camera) { m_CanDoPhoto = true; m_Camera.startPreview(); } }; 
by | 28 views

4 Answers

0 like 0 dislike
Here is the answer directly from the developer Android:
\rgroups.google.com/group/android-developers/browse_thread/thread/65191ea020f6bb27/
\r
In short, rawCallback never worked and most likely never will.
This kind colbecki was not intended for signal processing but only for capturing images.
by
0 like 0 dislike
I'm afraid so. Uncompressed is available only preview (all sorts of barcode scanners, etc. use it to preview callbacks).
by
0 like 0 dislike
Uncompressed you no the image will not give up due to the limit of the allocated memory for the application. Uncompressed picture 5MP uncompressed will weigh about 40MB while the desire to limit one application 24мб.
by
0 like 0 dislike
That is, it turns out that to obtain a "raw" camera image is not? Only in the form of already compressed JPEG?
And there is not any workarounds? Maybe with the Native SDK?
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,868 users