Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Employee
138 Views

How to compile opencv examples in OpenVino

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
Highlighted
138 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
Highlighted
Employee
138 Views

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

0 Kudos
Highlighted
Employee
138 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
Highlighted
Employee
138 Views

Hi Maksim

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

0 Kudos
Highlighted
New Contributor II
138 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
Highlighted
Employee
138 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
Highlighted
Beginner
138 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
Highlighted
Beginner
138 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