c++ - How to set up use of camera on Android with OpenCV + Qt5 -
there numerous questions around here, qt sites , opencv sites, none of them quite match case. (and lot unanswered anyway.)
i'm using opencv android 2.4.6 (the prebuilt version downloadable official site) build native app android (4.1.2) on samsung galaxy note 2 qt 5.0.1 android (using qtcreator 2.7.2) on x86_64 linux host.
i've linked against libraries in ../sdk/native/libs/armeabi-v7a folder. (i haven't built opencv source, i'm using in downloaded package). includes libopencv_androidcam.a library. (and i've tried libnative_camera_r4.1.1.so shared lib.) i've downloaded market app "opencv manager".
the sample .apks samples directory work on phone, haven't tried build them on own, don't have java development environment set up.
starting application, contains cv::videocapture inputcapture(cv_cam_android);
statement, following error , no camera input:
e/opencv::camera(15299): camerawrapperconnector::connecttolib error: cannot dlopen camera wrapper library e/opencv::camera(15299): native_camera returned opening error: 4
my questions:
- should work? have seen lot of bug reports, older opencv versions , newer/older android versions. bonus points if has been seen working on phone model.
- should work out of box downloaded opencv android sdk? or need build opencv source special options? (which ones?)
- do need special library versions on phone itself? need have root access device make work?
- are there "known working" andoid examples using native code instead of java?
thanks lot help!
i'll repeat answer got user @moster @ http://answers.opencv.org here:
copy libnative_camera_r4.1.1.so folder /sdk/native/libs/armeabi-v7a qt project's folder /android/libs/armeabi-v7a. make sure have allowed camera in android_manifest in qt creator. maybe helps
this indeed works. while mentioned camera permissions in manifest.xml (or rather qt project settings), copying shared lib project directory did trick.
seems it's found , linked during build, not copied device original location. neither "copy local qt libs device" in deploy settings (qt libs only?) nor opencv manager app (only loads right libs when called directly java code?) helped before.
Comments
Post a Comment