Ask Your Question

Capt Ned's profile - activity

2013-09-20 02:45:52 -0600 received badge  Necromancer (source)
2012-09-16 20:37:55 -0600 received badge  Editor (source)
2012-09-16 16:23:00 -0600 commented answer Android OpenCV support

Let me first say, fantastic work, simply amazing. Now to the questions. First, is there going to be any work-around or fix with the OpenCV using the Native Camera where vendors have modified it? Second, could someone please update the tutorials with this information, as it took a long time to find this information. Thanks, really nice work.

2012-09-16 15:12:12 -0600 answered a question Camera Not working

Wow, simply amazing, although is this really an answer to the camera not working: "fix is to build android and opencv"... I really don't want to build Android, nor build OpenCV; I was having the same problem, and I switched to a different brand of device, from Samsung Galaxy S, to an HTC Slide, and then all the tutorials and demos ran fine. If anyone has a solution, other than rebuilding ANDROID, please let me know.

As for the gentleman who did the rebuilding, hats off to you! Amazing work. If you have the knowledge to rebuild Android, and to rebuild OpenCV, you should be writing the tutorials, not following them!

UPDATE: I found a way to get the tutorials working! Just don't use the Native Camera code! Modify the tutorials that use the SampleCvViewBase class to use the SampleViewBase class in the other tutorials. The key is to modify the processFrame to convert the data for a VideoCapture to a byte[], so:

capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);

becomes

Mat mYuv = new Mat(getFrameHeight()+getFrameHeight()/2, getFrameWidth(), CvType.CV_8UC1);
mYuv.put(0, 0, data);
Imgproc.cvtColor(mYuv, mRgba, Imgproc.COLOR_YUV420sp2RGB, 4);
Imgproc.cvtColor(mRgba, mGray, Imgproc.COLOR_RGB2GRAY, 0);