OpenCV imshow () does not work

I wrote openCV code, and my code has the following statement:

cv::imshow("Matches", matchesImg); cv::waitKey(0); 

When I run the code in Debug or Release, I can not see the window that shows me the result.

And this happens for every project that I create.

Failed to find out the reason, can someone please direct me to this?

I am encoding Windows 7 and Visual Studio 2010, with opencv version 2.4.6

+8
c ++ io visual-studio-2010 opencv computer-vision
source share
1 answer

As I mentioned in the comments, first you need to create a window using namedWindow with the same window name as in imshow For more details see tutorial .

EDIT

This is highly recommended to create a window in advance. Some may argue that this did not work for previous versions of OpenCV. Then let's say that this solution applies, at least to OpenCV 2.4.6, which is a problem of concern here (and it solved the problem).

+3
source share

All Articles