CONFLICT WITH INSTALLING OPENCV 2.4.2 - opencv

I downloaded OpenCV-2.4.2 and I couldn't find any exe(auto run) file there.How ever I extracted that in to my C:\ directory and followed the following process in this video>>
https://www.youtube.com/watch?v=cgo0UitHfp8&feature=plcp
I have VS 2008 version. According to the video first I Added OpenCV to system variables and next build Visual Studio project. Added all the libraries and completed according to the video.
But When I debug my project it says>>
The application has failed to start because tbb_debug.dll was not found.
So;
1)Are there any wrong in my installation or this video?
2)Did I completed the installation process correct?
I must be thankful to u if u reply this soon.
Thank U

You are missing tbb_debug.dll (or it's not in your path)
If you built (or downloaded) opencv with TBB enabled then you need to install tbb and then put tbb.dll and tbb_debug.dll on the path (eg. copy to the opencv bin folder)

Related

Building an OpenCV Application with Static Libraries

Edit:
Problem solved after a few steps. You can take a look at my post on the OpenCV Q&A page.
http://answers.opencv.org/question/152366/build-application-with-static-libraries/
I'm trying to statically link my C++ (CMake) application to run on another computer which does not have OpenCV installed.
So far,
I built OpenCV from source by setting BUILD_SHARED_LIBS to OFF, so I can see library files under lib directory. (with .a extension)
I edited the environment variable for the new build of OpenCV, my IDE does see include directories and files, so this step also seems ok.
Added "-static" parameter to target_link_libraries command in CMake:
target_link_libraries(HoGPeopleDetector ${OpenCV_LIBS} "-static")
Then rebuilt the application, EXE size increased to 1.6 MB from 200 KB. So I guess linking process was successful.
The application works well when I run it within my IDE. However, when I try to run it from the EXE file, it still expects DLL files. (libopencv_core310.dll and maybe more)
IDE: CLion 2017.1.2 OpenCV: 3.1
Problem solved after a few steps. You can take a look at my post on the OpenCV Q&A page.
http://answers.opencv.org/question/152366/build-application-with-static-libraries/
Overall, it was "remember to clear your CMake cache file between each invocation of cmake" and to move/copy the opencv_ffmpegXXX.dll (310 in my case), put it in the same directory with your EXE.

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.

Building OpenCV 2.4.10 + Windows 7 + Visual Studio 2013, guide and error solving

I have been trying to build OpenCV 2.4.10 on Windows 7 32bit using Visual Studio 2013 and it has been a real pain. I have make some achivements but unfortunatelly it is not working 100%.
I would like to write a small manual not so focused on the step by step -it can be frustrating when one of those steps fails and you don't know how to reach the next one- and more focused on understanding what is happening on each step, why and what to expect when something goes wrong.
I ask for your help, sure you have faced lot of them before and can explain why it is happening.
I am downloading 3 to build with CMake 3.0.2 and Visual Studio 2013. I will update this thread as I take steps.
My aim is to build 2.4.10 with CUDA, TBB and OpenGL support. And make it work :)
Clone OpenCV 2.4.10 (I am using TortoiseGit at C:\OpenCV\src\src)
Download TBB Compiled
Unzip TBB in C:\OpenCV\src\opt\tbb
Unzip OpenCV source in C:\OpenCV\src dir
Open CMake and target source dir C:\OpenCV\src and built dir C:\OpenCV\built
Configure CMake for the first time
Select Visual Studio 12 2013, Use default native compilers for a configuration Win32
Select this options:
Under WITH tab:
WITH_CUDA (already checked)
WITH_OPENGL
WITH_TBB
And click configure again...
Here, OPENGL libs are found (opengl32 and glu32) and first missing paths appear (TBB_INCLUDE_DIRS), those for TBB_INCLUDE_DIRS, so:
Point that line to C:\OpenCV\src\opt\tbb\include and click configure again.
After that configuration process, TBB tab appears in red with LIB_DIR and STDDEF_PATH labels pointed to my TBB folder.
Click configure again to confirm the changes.
This time, there are no tag in red, and everything seems to be fine. I check the output and GUI OpenGL support is set to Yes, and so is Use TBB (ver 4.3 interface 8002) under Other third-party libraries, so
Click Generate to generate the Visual Studio files
Files are generated, so
Open Visual Studio 2013 and open OpenCV solution at C:\OpenCV\built and wait for it to be ready
Select Debug and then Build Solution (Ctrl+Shift+B) and wait...
First errors happen when it tries to find the core lib, so I re-run CMake for a simple build, without OpenGL, CUDA or TBB.
I have found this guide:
Which point to several of the problems I have been having. After compiling with its recommendations now I am having a particular problem regarding throw_nogpu that I will look for.
This guide solved my problems with CUDA, OpenGL and TBB:
http://initialneil.wordpress.com/2014/09/25/opencv-2-4-9-cuda-6-5-visual-studio-2013/
I hope it helps.

Building Opencv 2.4.9 with VS 2012, install generates incorrect header files

I'm trying to build openCV version 2.4.9 from the git repository. I've followed the instructions to run cmake-gui to build a visual studio solution. I've then built the VS studio solution in both relase and debug mode and then run the install build.
The install build puts all of the compiled libs into the install folder along with the include folder.
The problem is the include folder is completely wrong and missing a number of files. When I add the include folder path to a HelloWorld project it can't find any of the opencv methods classes etc.
Its as though the cmake build process has been corrupted in some way and doesn't properly prepare the include folder with the required header files.
I've tried this for both VS 2010 and VS 2012 cmake configurations and got the same result. Everything compiles fine, the header files in the install directory however aren't right.
Copying header files from a pre-built windows installation sort of work, and i'm confused as to why the build process doesn't result in a similar folder structure of header files.
This is really a bug and it has been reported twice. The description of the first link provides the fix:
The regex on this line is no longer corect:
https://github.com/Itseez/opencv/blob/master/cmake/OpenCVModule.cmake#L520
it should be replaced by: /[/]+.h(..)?$
I'll just update this post to keep it up-to-date with the latest git version of opencv.
On current release the bug is still there and now located # line 538 of cmake/OpenCVModule.cmake. The proposed solution is to replace the actual line 538:
if(hdr2 MATCHES "^(opencv2/.*)[^/]+.h(..)?$" AND NOT hdr2 MATCHES "opencv2/${the_module}/private.*")
by
if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
Thanks a lot to the author of this patch that saved me a headhake...

opencv2.1 settings in visualc++2010

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.

Resources