开发者

OpenCV-Android highgui linking error

I am using opencv on Android and have been successfully loading and processing jpg images from the phone's SD card. Now I want to manipulate frames from a video stored on the SD card. I have coded and tested the opencv code in C++, but am having a linking error when trying to put it into my android-opencv project. Specifically, when I add the line of code

CvCapture* capture = cvCreateFileCapture( "/sdcard/testVideo.MOV" );

And then try to rebuild the project I get the following output/error:

OPENCV_CONFIG = ../../build/android-opencv.mk
PROJECT_PATH defaulting to this directory
/Users/me/Documents/Android/android-ndk-r4-crystax/ndk-build OPENCV_CONFIG=../../build/android-opencv.mk PROJECT_PATH=. V=0 
Compile++ thumb: Assay <= /Users/me/Documents/Android/opencv/android/apps/MyApp/jni/Processor.cpp
SharedLibrary  : libAssay.so
/Users/me/Documents/Android/opencv/android/build/obj/local/armeabi-v7a/libhighgui.a(cap.o): In function `cvCreateVideoWriter':
cap.cpp:(.text.cvCreateVideoWriter+0x16): undefined reference to `cvCreateVideoWriter_Images(char const*)'
cap.cpp:(.text.cvCreateVideoWriter+0x20): undefined reference to `cvCreateVideoWriter_Images(char const*)'
/Users/me/Documents/Android/opencv/android/build/obj/local/armeabi-v7a/libhighgui.a(cap.o): In function `cvCreateFileCapture':
cap.cpp:(.text.cvCreateFileCapture+0x2): undefined reference to `cvCreateFileCapture_Images(char const*)'
collect2: ld returned 1 exit status
make[1]: *** [/Users/me/Documents/Android/opencv/android/apps/MyApp/obj/local/armeabi/libAssay.so] Error 1
make: *** [libs/armeabi-v7a/libAssay.so] Error 2

It seems like it's having problems linking to the cvCreateFileCapture. I have read that the order in which the opencv libraries are specified matters, but am not sure what order I should use (or if this is my problem). My opencv libraries are specified in this order:

OPENCV_LIBS := $(OPENCV_LIB_DIRS)开发者_JAVA百科 -lfeatures2d  -lcalib3d -limgproc -lobjdetect  \
     -lvideo  -lhighgui -lml -llegacy -lcore -lopencv_lapack -lflann \
    -lzlib -lpng -ljpeg -ljasper 

Anyone have any idea how to get cvCreateFileCapture working?

Thanks!


To address this issue, assuming you are working off trunk, you may svn up to grab a fix for the linker issue: https://code.ros.org/trac/opencv/changeset/4756

However this now only supports the capture from a sequence of images:

// capture video from a sequence of images
// the filename when opening can either be a printf pattern such as
// video%04d.png or the first frame of the sequence i.e. video0001.png

To truly support video read/write, we will need to add ffmpeg or other video library support. I've seen ffmpeg ports floating around, but haven't had time or a need to add them to opencv for android. Let me know if this is valuable, or if you've done it already and submit a patch. Be sure to do this through the opencv trac site.

https://code.ros.org/trac/opencv/wiki

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜