2

Similar to OpenCV 2.3: how to capture frames from Android camera?

I'm trying to get OpenCV to run on my Samsung Fascinate (v2.2.1) following this tutorial

When I try to run the samples (like sample 15-puzzle) for instance, I get the following errors:

03-31 14:05:39.399: D/dalvikvm(4915): Trying to load lib /data/data/org.opencv.samples.puzzle15/lib/libopencv_java.so 0x47c22ef8
03-31 14:05:39.399: D/dalvikvm(4915): Shared lib '/data/data/org.opencv.samples.puzzle15/lib/libopencv_java.so' already loaded in same CL 0x47c22ef8
03-31 14:05:39.399: D/CAMERA_ACTIVITY(4915): Library name: libopencv_java.so
03-31 14:05:39.399: D/CAMERA_ACTIVITY(4915): Library base address: 0x81800000
03-31 14:05:39.418: D/CAMERA_ACTIVITY(4915): Libraries folder found: /data/data/org.opencv.samples.puzzle15/lib/
03-31 14:05:39.426: D/CAMERA_ACTIVITY(4915): CameraWrapperConnector::connectToLib: folderPath=/data/data/org.opencv.samples.puzzle15/lib/
03-31 14:05:39.426: E/CAMERA_ACTIVITY(4915): ||libnative_camera_r2.2.2.so
03-31 14:05:39.426: E/CAMERA_ACTIVITY(4915): ||libnative_camera_r2.3.3.so
03-31 14:05:39.426: D/CAMERA_ACTIVITY(4915): try to load library 'libnative_camera_r2.2.2.so'
03-31 14:05:39.434: D/CAMERA_ACTIVITY(4915): CameraWrapperConnector::connectToLib ERROR: cannot dlopen camera wrapper library /data/data/org.opencv.samples.puzzle15/lib/libnative_camera_r2.2.2.so, dlerror="Cannot load library: link_image[1995]: failed to link libnative_camera_r2.2.2.so
03-31 14:05:39.434: D/CAMERA_ACTIVITY(4915): "
03-31 14:05:39.434: D/CAMERA_ACTIVITY(4915): try to load library 'libnative_camera_r2.3.3.so'
03-31 14:05:39.434: D/CAMERA_ACTIVITY(4915): CameraWrapperConnector::connectToLib ERROR: cannot dlopen camera wrapper library /data/data/org.opencv.samples.puzzle15/lib/libnative_camera_r2.3.3.so, dlerror="Cannot load library: link_image[1995]: failed to link libnative_camera_r2.3.3.so
03-31 14:05:39.434: D/CAMERA_ACTIVITY(4915): "
03-31 14:05:39.434: E/CAMERA_ACTIVITY(4915): CameraWrapperConnector::connectToLib ERROR: cannot dlopen camera wrapper library
03-31 14:05:39.434: E/CV_CAP(4915): Native_camera returned opening error: 4
03-31 14:05:39.434: E/Sample::SurfaceView(4915): Failed to open native camera

So the library cannot be opened. Any ideas on why? Is it not being found?

Update:This also happens on the emulator.

Community
  • 1
  • 1
Jason
  • 13,563
  • 15
  • 74
  • 125
  • I did a quick search, but unsure what you mean. Other android applications work fine on my phone and it seems to find in while on the emulator, but not on my device (so I think it's a runtime issue) – Jason Mar 31 '12 at 19:12
  • Sorry, there was a misunderstood. My fault. Deleting previous comment. Which sdk do you have in your phone and emulator? Are they same? And did you do the step in the following post? [link](http://stackoverflow.com/a/8016306/856702) – Cihad Turhan Mar 31 '12 at 19:35
  • They are both 2.2. Not sure if the link applies since I already have the libraries on my computer. I wonder if it's a bug. – Jason Mar 31 '12 at 20:57

1 Answers1

2

Make sure libnative_camera_r2.2.2.so is in libs/. That file should be packaged so that it can be loaded dynamically by dlopen.

Chen Xing
  • 1,665
  • 2
  • 13
  • 13