How can I do Image processing on JPEG data

by srik » Mon, 13 Apr 2009 12:47:55 GMT

Sponsored Links

I am confused on how to implement image processing algorithm on JPEG
data.I have set P.setpicturesize (640,480) so the  camera.takepicture
(null,null,Imagecapture callbck) returns the image data.

Void onPictureTaken(byte[] data, Camera Camera) returns JPEG data,
but     ------->(x = data.length) , the value of x is less than
640*480 bytes.Please kindly let me know how can I start editing pixel
information of the image and image comparison algorithms.

thank you,

Other Threads

1. Spying camera application


I  worked on N95 mobile, my goal is to capture image  for every 2 min
send the image data to server without user help.I am done with image
capturing manually but I am unable to capture image automatically
you please suggest me.I am getting certification message pop up. Is
there any way to start
my application automatically.I am messed with code signature and
manufacturer agreement with Nokia.So
I have decided  to change the platform to Android mobiles.Could you
let me can I able to implement the above application in android
android platform.

Thank you,



2. OutofMemory exception when dealing with large Bitmaps

I wrote a sample application which rotates and scales a bitmap on
clicking a key. When the bitmap is large (1280x1024) I quickly run
into an OutOfMemory exception at CreateBitmap and I need to Force
Close the application. No issues with smaller bitmaps.

I have already tried using bitmap.recycle and setting the bitmap to
null, but the memory does not get freed up. I have seen multiple posts
with similar issues, but could not find one that solves my issue. Do I
need to force the GC at some point? Here is the code I am using:

public class TransformAndroid extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        LinearLayout linLayout = new LinearLayout(this);

        mBitmapOrg = BitmapFactory.decodeResource(getResources(),

        mScaleWidth = 0.1f;
        mScaleHeight = 0.1f;
        mRotateAngle = 0;

        mImageView = new ImageView(this);


        // center the Image

        // add ImageView to the Layout
          new LinearLayout.LayoutParams(

        // set LinearLayout as ContentView


    private void TransformThePicture()
        Matrix matrix = new Matrix();
        matrix.postScale(mScaleWidth, mScaleHeight);

        int width = mBitmapOrg.getWidth();
        int height = mBitmapOrg.getHeight();

        mResizedBitmap = Bitmap.createBitmap(mBitmapOrg, 0, 0,
                width, height, matrix, true);



    public boolean onKeyDown(int keyCode, KeyEvent event) {
           if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {

                  mScaleWidth += 0.08;
                  mScaleHeight += 0.05;
                  mRotateAngle += 5;

                  if (mScaleWidth >= 1.0f) mScaleWidth = 0.1f;
                  if (mScaleHeight >= 1.0f) mScaleHeight = 0.1f;
                  if (mRotateAngle >= 90) mRotateAngle = 0;


              return (true);

           return super.onKeyDown(keyCode, event);

    private Bitmap mBitmapOrg;
    private float mScaleWidth;
    private float mScaleHeight;
    private int mRotateAngle;
    private ImageView mImageView;
    private Bitmap mResizedBitmap;


3. Buffering Background Image - Graphics Advice Sought

4. Question about one application requiring another application or service

5. rating bar padding problem

6. How to update Android Dev 1

7. R not re-generating in Eclipse after rename of the package