asked 2012-09-24 09:23:59 -0600Thalion
Hello, I'm new to OpenCV and more generally to "computer vision" and android.hardware.Camera. I try to run the examples (tutorial-0-androidcamera et tutorial-1-addopencv) and nothing works.
For the first, the LogCat say :
And for the second :
I saw that there were some known issues with the previous version, but were theoricaly corrected with the latest one. However, I tried to compare yesterday solutions with today's code, and i can't explain what's going wrong.
sorry for my bad english
answered 2012-12-11 11:54:37 -0600steveT
Lately I tried my Android app with opencv 2.4.0 on Jelly Bean and I got the same error. I solved it by removing the following two lines in ViewBase.setPreview
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) mCamera.setPreviewTexture( new SurfaceTexture(10) ); else mCamera.setPreviewDisplay(null);
and replaced it with
Now it's not possible to write to the SurfaceView that was originally used for the preview because the canvas is constantly locked. So I removed the writing-to-the-canvas stuff from the ViewBase's thread and registered a callback in the View which is executed in onProcessFrame so that I have the image data some where else. Now I can process the image data and write it to another SurfaceView which overlays the original camera output.
answered 2012-12-14 03:09:02 -0600V.G.
If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.
Asked: 2012-09-24 09:23:59 -0600
Seen: 521 times
Last updated: Dec 14 '12