Wednesday, November 26, 2014

11

HOW TO INSTALL OPENCV 3.0.0 IN WINDOWS 8

Although I always recommend using Linux on any of its variants, Windows is still being used by the majority of beginners in Computer Vision. Therefore, after receiving many requests, here is an explanation on how to install OpenCV 3 in Windows 8 :


and how to set up your Visual Studio 2013 environment to start programming computer vision applications:


Here is the source code for the test described on the video, it just prints out the version of OpenCV installed on your system:


#include <iostream>
#include <opencv2/opencv.hpp>

void main()
{
  std::cout << "OpenCV Version: " << CV_VERSION << std::endl;
}

11 comments:

Piyush said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Unknown said...

I got the code you give to work but as soon as I start with other opencv code it gives me errors.
This is my code:

#include
#include
#include

int main()
{
cv::Mat input = cv::imread("lena.jpg", 1);
if(!input.data) {
std::cout << "Unable to open the image file" << std::endl;
return -1;
}

return 0;
}

with this I get errors such as:

Error 1 error LNK2001: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPAX@Z) d:\Users\Savva\documents\visual studio 2012\Projects\OpenCV-Test\OpenCV-Test\Source.obj OpenCV-Test

Error 2 error LNK2001: unresolved external symbol "class cv::Mat __cdecl cv::imread(class cv::String const &,int)" (?imread@cv@@YA?AVMat@1@ABVString@1@H@Z) d:\Users\Savva\documents\visual studio 2012\Projects\OpenCV-Test\OpenCV-Test\Source.obj OpenCV-Test

Error 3 error LNK2001: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) d:\Users\Savva\documents\visual studio 2012\Projects\OpenCV-Test\OpenCV-Test\Source.obj OpenCV-Test

Error 4 error LNK2001: unresolved external symbol "private: void __thiscall cv::String::deallocate(void)" (?deallocate@String@cv@@AAEXXZ) d:\Users\Savva\documents\visual studio 2012\Projects\OpenCV-Test\OpenCV-Test\Source.obj OpenCV-Test

Error 5 error LNK2001: unresolved external symbol "private: char * __thiscall cv::String::allocate(unsigned int)" (?allocate@String@cv@@AAEPADI@Z) d:\Users\Savva\documents\visual studio 2012\Projects\OpenCV-Test\OpenCV-Test\Source.obj OpenCV-Test

Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
ronman said...

I am having trouble getting this to work, the biggest problem is getting Visual Studio to recognize the included file from OpenCV, but also, cstdio does not include std::cout. printf could be used, but in order to use cout, one must include iostream.

Martin Peris said...

You are absolutely right! cstdio is the wrong include. My bad! fixing it immediately.

Regarding Visual Studio not recognising OpenCV's include files, triple check all the paths that you entered, also the environment variables that you created. It is likely that you mistyped something.

Also, after setting the environment variables, make sure to reboot your computer, or at least restart your session.

Hope you can get it to work soon

Unknown said...
This comment has been removed by the author.
нєαят нυηтєя уαѕн (ρяιηcє σƒ нєαят нυηтιηg ) said...
This comment has been removed by the author.
Yadullah Abidi said...

Hi there. I am having trouble running the code. I did everything exactly the way you told me but when I run the code I get errors on 2 lines.
1. #include
2. CV_VERSION (has a red line under it saying that it cannot find it)
Can you please tell me how to fix it? I'm completely new to openCV
Thanks

dot said...

setting failed sir.

Post a Comment