Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Please dont use IplImage on android. IplImage is deprecated in c++ and java.

Here is some code that should basically work. Please test it:

imView.buildDrawingCache();
Bitmap bmap = imView.getDrawingCache();
Bitmap bmapCv = bmap.copy(Bitmap.Config.ARGB_8888, true);
Mat imgMat = new Mat();
Utils.bitmapToMat(bmp32, imgMat);

Please dont use IplImage on android. IplImage is deprecated in c++ and java.

Here is some code that should basically work. Please test it:

imView.buildDrawingCache();
Bitmap bmap = imView.getDrawingCache();
Bitmap bmapCv = bmap.copy(Bitmap.Config.ARGB_8888, true);
Mat imgMat = new Mat();
Utils.bitmapToMat(bmp32, imgMat);

IplImage for javacv (not tested)

IplImage img = IplImage.create(cvSize(width, height) IPL_DEPTH_8U, 4);
Bitmap bmap = imView.getDrawingCache();
Bitmap bmapCv = bmap.copy(Bitmap.Config.ARGB_8888, true);
bitmap.copyPixelsToBuffer(img.getByteBuffer());