I am starting to use opencv for my project but I experienced some issue when setting up it in vs 2012.
I download OpenCV 2.4.13. I go through a lot of tutorial but I got an error saying that
The program can't start because opencv_core2413d.dll is missing from your computer. Try reinstalling the program to fix this problem
Here is all my steps to setup:
1) setup Windows environment variable, Path to "C:\\opencv\\build\\x64\\vc11\\bin"
2) Open an empty project in vs 2012, change the configuration manager to 64 bit platform.
3) Then add "C:\\opencv\\build\\include" and "C:\\opencv\\build\\include\\opencv" in VC++ Directories -> Include Directories
4) Add "C:\\opencv\\build\\x64\\vc11" in VC++ Directories -> Library Directories
5) Switch to C/C++ -> General -> additional include directories, add "C:\\opencv\\build\\include"
6) Add "C:\\opencv\\build\\x64\\vc11\\lib" to Linker -> General -> Additional Library Directories
7) Add the following to Link -> Input -> additional dependencies
opencv_core2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_features2d2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
Here is my test main to use openCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv ){
Mat image;
if( argc != 2){
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
image = imread("HappyMan's Girl.jpg", CV_LOAD_IMAGE_COLOR);
// Read the file
}
else{
image = imread(argv[1], CV_LOAD_IMAGE_COLOR);
}
if(! image.data ){// Check for invalid input
cout << "Could not open or find the image" << endl ;
system("pause");
return -1;
}
namedWindow( "HappyMan - Display window", CV_WINDOW_AUTOSIZE );
// Create a window for display.
imshow( "HappyMan - Display window", image );
// Show our image inside it.
waitKey(0);
// Wait for a keystroke in the window
return 0;
}
Can I get some help on this?
Thanks
updated my system variables settings image:
Just paste the dll files in your project directory where .exe file is present and you will be good to go. Another method is to paste the .dll files in System32 folder( haven't tried it though) eg C:\\Users\\Reaper\\Documents\\Visual Studio 2013\\Projects\\ConsoleApplication1\\Debug Hope this helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.