How can I do Image processing on JPEG data

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


Sponsored Links
 Hi

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,
Srikanth
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Spying camera application

Hi

I  worked on N95 mobile, my goal is to capture image  for every 2 min
and
send the image data to server without user help.I am done with image
capturing manually but I am unable to capture image automatically
could
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
please
let me can I able to implement the above application in android
mobiles
android platform.


Thank you,

Sri


--~--~---------~--~----~------------~-------~--~----~

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. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout linLayout = new LinearLayout(this);

        mBitmapOrg = BitmapFactory.decodeResource(getResources(),
               R.drawable.sample);

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

        mImageView = new ImageView(this);

        TransformThePicture();

        // center the Image
        mImageView.setScaleType(ScaleType.CENTER);

        // add ImageView to the Layout
        linLayout.addView(mImageView,
          new LinearLayout.LayoutParams(
                      LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT
                )
        );

        // set LinearLayout as ContentView
        setContentView(linLayout);

    }

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

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

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

        mImageView.setImageBitmap(mResizedBitmap);
        mImageView.invalidate();

    }

    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;

              mResizedBitmap.recycle();
              TransformThePicture();

              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