opencv2.1 settings in visualc++2010 - opencv

i'm using opencv2.1 with visualstudio2010
while debugging it is showing this error message:
'the program can't start because cxcore210.dll is missing from your computer. Try reinstalling the program to fix this program.'
but cxcore210.dll is already present in the /bin folder
any suggestions?

You need to make sure the dll is in your system path or in the same folder as the executable. The best way is to add the OpenCV /bin folder to your PATH environment variable.
http://www.mattmontag.com/development/notes-on-using-opencv-2-3-with-visual-studio-2010
With the runtime errors you are now having that suggest you are using the OpenCV binaries compiled in Visual Studio 2008, the easiest option is to get the OpenCV 2.3.1 Win superpack distribution. It comes with binaries compiled in vs2008 and vs2010. Please see my blog because it also has instructions for configuring this distribution! :)
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/OpenCV-2.3.1-win-superpack.exe/download
Also - the documentation for OpenCV 2.3 at http://opencv.itseez.com/ is generally much cleaner and better than the other versions.

Related

Installing MinGW-W64

In the installation instructions for Windows at GoCV we've the below line:
Download and run the MinGW-W64 compiler installer from https://sourceforge.net/projects/mingw-w64/?source=typ_redirect.
I downloaded the mentioned file, but could not find executor file, and could not find anything like x86_64-7.3.0-posix-seh-rt_v5-rev2 as mentioned in the instuctions, any help?
The installation of MinGW-w64 is simple. Either download the installer from
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe
or the appropriate package (as a 7-zip archive) directly:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-posix/seh/x86_64-7.3.0-release-posix-seh-rt_v5-rev0.7z/download
Some people (including me) experienced random connection problems with the installer at some point, so the second options might be more straightforward.

How to install OpenCV 3.1 with nonfree module?

I'm trying to write a program that uses SURF algorithm and I know that the nonfree module must be installed separately. I've downloaded and installed the latest version of CMake(3.5.2) and I'm following the instructions from:
https://github.com/itseez/opencv_contrib/ . I'm using the GUI and I run Visual Studio 2015 on a 64 bit Windows 10.
Since I know that for SURF you must include xfeatures2d when it asked me the source of the code I only specified the xfeatures2d folder. When I first pressed the configure button I had some errors(I've attached an image of them). I managed to get rid of one of the errors, the one that said to write a line of code at the top of the file
cmake_minimum_required(VERSION 3.5), but I still have one error:
CMake Error at CMakeLists.txt:4 (ocv_define_module):
Unknown CMake command "ocv_define_module".
I'm also attaching a picture of the CMakeLists.txt. Please help me find the problem.
Also, if you could help my install all modules at once, I would be grateful. Or do I have to set as input every folder in the modules folder?
GUI error and CMakeLists.txt
Try using Visual Studio 12 2013 for compilation, this has worked for me, but not the other (newer) versions of Visual Studio.

OpenCV 3.0 x64 VS2013 error LNK1104

read already some other threads about these..tried so far everything...
nothing worked. double checked everything.
using x64 system, VS13(x32) and x64 as target system (though i tried using x32 before and had
the same error)
anyways here are my links:
Debug x64
VC++ exec directory: K:\A_A_Programmierung\opencv\build\x64\vc12\bin;$(ExecutablePath)
VC++ lib: K:\A_A_Programmierung\opencv\build\x64\vc12\lib;$(LibraryPath)
C/C++: K:\A_A_Programmierung\opencv\build\include;%(AdditionalIncludeDirectories)
Linker: Target Computer: MachineX64 (/MACHINE:X64)
additional dependencies:
opencv_calib3d300d.lib;opencv_core300d.lib;opencv_features2d300d.lib;opencv_flann300d.lib;opencv_highgui300d.lib;opencv_imgcodecs300d.lib;opencv_imgproc300d.lib;opencv_ml300d.lib;opencv_objdetect300d.lib;opencv_photo300d.lib;opencv_shape300d.lib;opencv_stitching300d.lib;opencv_superres300d.lib;opencv_ts300d.lib;opencv_video300d.lib;opencv_videoio300d.lib;opencv_videostab300d.lib;%(AdditionalDependencies)
Additional lib. directory:
K:\A_A_Programmierung\opencv\build\x64\vc12\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%(AdditionalLibraryDirectories)
also checked some other settings mentioned in other threads!
and did set the enviroment variable as mentioned in a tut and also ran VS13 as admin
any help?
ok fixed it myself...
you have to add the files of opencv 3.0 under opencv\build\x86\vc12\lib
for the linker input. (see additional dependencies) which isnt the whole list anymore...
list on the official tutorial is not up to date!
Try using $(OPENCV_DIR)\staticlib instead of $(OPENCV_DIR)\lib.

ImageMagick with Visual Studio

I'm trying to write a sample ImageMagick program in Visual Studio 2010. I have binary distribution of ImageMagick already installed on my system as I can use command line interface of ImageMagick.
However, when I try to include "Magick++.h" in my C++ program, it says it can't open source file.
I found the instructions on compiling and building ImageMagick from source, but is it possible to change my visual studio project settings so it can pick necessary references/libraries from the already installed version of ImageMagick?
I am by no means an expert, but here is what worked for me:
Using Windows7 Professional and Visual C++ Express 2010...
I checked the Install development headers and libraries for C and C++
At the end of the install, I got these two folders. Magick++.h lies inside include.
Be sure to set up your projects Additional Library Locations and Additional Include Directories and you should be able to compile your program.
Additionally:
The manual suggests you need to do this for your program to work, but I did not and it still worked:
InitializeMagick(path_to_ImageMagick_DLLs);
And during my brief test, I found that Magick::Image::Magick() which changes image formats does not work in Debug mode. It does work in Release mode though.

error PRJ0003 : Error spawning 'cl.exe'

I converted VS2006 vc++ project to VS2008. When compiling I get the above error. How do i fix it? am I missing this exe ?
There is a bug in the Visual Studio 2008 Standard Edition installer. It does not install cl.exe if you only install Visual C++ but not Visual C#. To work around this you have to install Visual C# even if you do not need this.
cl.exe is VS2008 (and any other VS) C/C++ compiler, so check for more detailed error message why it cannot be spawned. Be sure you've installed C++ language support when installing VS2008.
It could be that your "path" environment variable does not contain the path to the folder where cl.exe is located.
Another possible reason could be that when installing VS2008, you did not select the option to install the Win32 tools (which include the command line compiler).
In any case, you may want to try to repair the installation of VS2008 (by running its setup via Control Panel - Add/Remove Programs), or use its "Add/Remove components" option and add the "Win32 tools" option (under Visual C++ - Visual C++ Tools).
I had this problem under Windows 10 and solved it by adding the following paths to the PATH environment variable:
C:\ProgramFilesC\VS2008\Common7\IDE
C:\ProgramFilesC\VS2008\VC\bin\x86_amd64
where C:\ProgramFilesC\VS2008 is the path where I installed Visual Studio.
Actually this error occurs because of path is not correctly set.
Goto Tools>Options>Directories> show directories for > Select Executable files
Here copy the path address from the folder where you installed and paste that path address
G:\Program files\vb (visual basic) 6.0\Visual Basic 6.0\VC98\BIN
then click OK.
This may work for you.

Resources