Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

openvino sample example "hello_classification" fail to build by adding VideoCapture object in its code.

Lalatendu_D_Intel
402 Views

Hi All,

I am trying to alter the hello-classification example present under /opt/intel/openvino/inference_engine/samples/hello_classification directory.

Intention is to read a video file and pass the image one by one in the code itself instead of passing it from command line one image per run.

Hence I have used opencv C++ VideoCapture() API. But the object instation code itself cribs about undefined reference. I have verified the LD_LIBARARY_PATH to be properly pointing to "/opt/intel/openvino_2019.3.334/opencv/lib"

The code i have added is as simple as one liner as below

cv::VideoCapture cap("/home/test_user/sample.avi");

Exact errors are pasted below:

----snip----

[100%] Linking CXX executable ../intel64/Release/hello_classification
CMakeFiles/hello_classification.dir/main.cpp.o: In function `main':
main.cpp:(.text.startup+0x88f): undefined reference to `cv::VideoCapture::VideoCapture(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
main.cpp:(.text.startup+0xc4d): undefined reference to `cv::VideoCapture::~VideoCapture()'
main.cpp:(.text.startup+0xe68): undefined reference to `cv::VideoCapture::~VideoCapture()'
collect2: error: ld returned 1 exit status
-----snip-------------

The same code links well for cv::imread() function. Please let me know if I missed to set any other environment variable.

 

0 Kudos
1 Reply
JesusE_Intel
Moderator
402 Views

Hi Lalatendu,

We have a simple classifier c++ demo using a camera with an Intel Neural Compute Stick 2. It may be easier to modify that sample to read a video file. Take a look the following code: https://github.com/movidius/ncappzoo/blob/master/apps/simple_classifier_cpp_camera/run.cpp

Hope this helps.

Regards,

Jesus

0 Kudos
Reply