I\'m writing an Android app in Eclipse that uses the OpenCV4Android API. How can I display a Mat
image easily, for debugging only? In C++, according to the OpenCV
This is a sample code which would display an image (must have the image in drawable folder) in imageView using OpenCV:
ImageVIew imgView = (ImageView) findViewById(R.id.sampleImageView);
Mat mRgba = new MAt();
mRgba = Utils.loadResource(MainAct.this, R.drawable.your_image,Highgui.CV_LOAD_IMAGE_COLOR);
Bitmap img = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(),Bitmap.Config.ARGB_8888);
Utils.matToBitmap(mRgba, img);
imgView.setImageBitmap(img);
and xml must have an ImageView as below :
Hope this helps in solving your problem..