I am trying to install OpenCV with contrib modules for Visual Studio 2019 on a Windows 10 machine.
I previously had a working version in Visual Studio 2017, but have been unable to get either 2019 or 2017 working recently.
I have been using CMake to install this, adding the extra modules path before generating. Once I have built the ALL_BUILD and INSTALL files I am not sure of where I am meant to add the libraries and include paths and I have found conflicting results between tutorials and neither seem to work.
My code won't include the libraries and says that it can't open the source file.
Here is my code:
#include <opencv2/core/core.hpp>
The error is:
Cannot open source file "opencv2/core/core.hpp"
I have reviewed the following materials to attempt to solve this but there are no up to date guides to include contrib modules nor any that work
this is a problem of the path to include directory. You can set directly the path in Project setting- C/C++ - General - Additional Include Directory: (c:/opencv/install/include) "Just example". Follow the picture. This will correct the problem with includes.
The Additional dependencies on the following picture provide opencv_MODULE420.lib, where module is core, video, videoio, etc. If you have a problem here, The message symbol is not resolved will occur.
I recently did a tutorial for this here funvision blog HERE in case you have a problem with installation by CMAKE. The tutorial includes the installation of GSTREAMER as well.