Ask Your Question

Quill Hon's profile - activity

2016-11-29 01:12:30 -0500 received badge  Famous Question (source)
2015-02-26 07:49:32 -0500 received badge  Notable Question (source)
2014-03-22 12:19:36 -0500 received badge  Popular Question (source)
2012-10-05 22:16:44 -0500 commented question Convert Mat to MatOfByte in Android

I want to pass the Image to Tesseract-OCR api with byte data array. Because I don't want to convert it to bitmap.

2012-10-04 01:02:12 -0500 received badge  Student (source)
2012-10-03 23:54:05 -0500 asked a question Convert Mat to MatOfByte in Android

I got a Mat from OpenCV's camera. And I want to convert it to a MatOfByte or a byte[]. But I got runtime error in my code:

Mat mGray = new Mat();    
capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
MatOfByte mGrayByte = new MatOfByte(mGray);

I got the error:

10-04 12:50:35.470: E/AndroidRuntime(25086): java.lang.IllegalArgumentException: Incomatible Mat 10-04 12:50:35.470: E/AndroidRuntime(25086): at org.opencv.core.MatOfByte.<init>(

The error line is:

MatOfByte mGrayByte = new MatOfByte(mGray);