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.

How to compile opencv examples in OpenVino

Yatish_M_Intel
Employee
1,462 Views

Hi

I am trying to compile opencv example located at /opt/intel/computer_vision_sdk/opencv/share/OpenCV/samples/pvl/facerecognizer.cpp and following instructions in /opt/intel/computer_vision_sdk/opencv/share/OpenCV/samples/README.md. When i run cmake --build . , i get following errors

 /opt/intel/computer_vision_sdk/opencv/share/OpenCV/samples/pvl/facerecognizer.cpp:9:27: fatal error: opencv2/pvl.hpp: No such file or directory

I am using computer_vision_sdk_fpga_2018.1.267 for the setup.

Thanks

Yatish

0 Kudos
8 Replies
Seunghyuk_P_Intel
1,462 Views

Hi Mishra Yatish,

I'm not sure how you exactly tested this but I could compile with this steps.

$ cd /opt/intel/computer_vision_sdk/opencv/share/OpenCV/samples

$ sudo mkdir -p samples_build && pushd samples_build

$ cmake /opt/intel/computer_vision_sdk/opencv/share/OpenCV/samples

$ sudo cmake --build .

$ popd

I also used same version of package.

Can you share how you did run commands?
 
Regards,
Peter.
0 Kudos
Yatish_M_Intel
Employee
1,462 Views

I ran exactly the same commands, maybe some environment variable is not set correctly ?

0 Kudos
Maksim_S_Intel
Employee
1,462 Views

Probably your cmake is too old, please check its version:

cmake --version

 

Try to add one line to the samples/CMakeLists.txt in your installation, after the messages block:

include_directories(${OpenCV_INCLUDE_DIRS})


 

0 Kudos
Yatish_M_Intel
Employee
1,462 Views

Hi Maksim

cmake version is 3.5.1. Adding that extra include didn't help. I still get the same error.

0 Kudos
RBang
New Contributor II
1,462 Views

Came across this issue on Github that details the same issue and how to solve it - https://github.com/opencv/opencv/issues/5989. In a nutshell, if you have a custom install of opencv2 in a local -I(system include path) directory, let's say /usr/local/myproject/include/opencv2 without objdetectcompiled, and a system one (e.g. older but does include objdetect) in /usr/include, then it looks for it in the /usr/include directory. Unfortunately even whereis opencv2 points to the /usr/include directory and I haven't been able to find the same opencv2 folder in the SDK folder that was created. Will update as soon as I find it.

0 Kudos
Yatish_M_Intel
Employee
1,462 Views

Thanks everyone

Peter helped me to root cause the issue. I had another version of OpenCV installed. I uninstalled it and now it works like magic :)

Best Regards

Yatish

0 Kudos
mohan__deepa
Beginner
1,462 Views

I am unable to install the /usr/local/OpenCV as I have a shared machine. What is the solution if we cannot uninstall the root version of open cv?

I see setupvars.sh has only OPENCV_DIR path. What should OpenCV_INCLUDE_DIRS point to?

 

Did setting include_directories(${OpenCV_INCLUDE_DIRS})help? 

 

0 Kudos
Kochar__Amrit
Beginner
1,462 Views
@Yatish Mishra I have by mistake installed more than one versions of OpenCV too. Can you help me out in uninstalling one of it. The one that I want to uninstall is installed in system default directories. The version that I want to keep in installed in /home/upsquared/amrit/installation/OpenCV-master/
0 Kudos
Reply