Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tuto Android 4.1.1 + OpenCV 2.4.2 + Nexus S

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 :

  • 09-21 14:35:47.800: E/BufferQueue(15201): [unnamed-15201-0] setBufferCount: SurfaceTexture has been abandoned!
  • 09-21 14:35:47.808: D/AndroidRuntime(15201): Shutting down VM
  • 09-21 14:35:47.808: W/dalvikvm(15201): threadid=1: thread exiting with uncaught exception (group=0x40cb3300)
  • 09-21 14:35:47.808: E/AndroidRuntime(15201): FATAL EXCEPTION: main
  • 09-21 14:35:47.808: E/AndroidRuntime(15201): java.lang.RuntimeException: startPreview failed
  • 09-21 14:35:47.808: E/AndroidRuntime(15201): at android.hardware.Camera.startPreview(Native Method)
  • 09-21 14:35:47.808: E/AndroidRuntime(15201): at org.opencv.samples.tutorial0.SampleViewBase.setupCamera(SampleViewBase.java:138)

And for the second :

  • 09-21 14:38:36.206: E/BufferQueue(15330): [unnamed-15330-0] setBufferCount: SurfaceTexture has been abandoned!
  • 09-21 14:38:36.206: D/AndroidRuntime(15330): Shutting down VM
  • 09-21 14:38:36.206: W/dalvikvm(15330): threadid=1: thread exiting with uncaught exception (group=0x40cb3300)
  • 09-21 14:38:36.214: E/AndroidRuntime(15330): FATAL EXCEPTION: main
  • 09-21 14:38:36.214: E/AndroidRuntime(15330): java.lang.RuntimeException: startPreview failed
  • 09-21 14:38:36.214: E/AndroidRuntime(15330): at android.hardware.Camera.startPreview(Native Method)
  • 09-21 14:38:36.214: E/AndroidRuntime(15330): at org.opencv.samples.tutorial1.SampleViewBase.setupCamera(SampleViewBase.java:138)

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.

I used this package : http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.2/OpenCV-2.4.2-android-sdk.zip/download

sorry for my bad english

David