0

I am currently working on object detection and before diving in I just tried the example demo tutorial from OpenCV. (You can see the tutorial code here: https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp).

So, my problem is when I build the program, I see a gray frame as detection window. Here is a solution for python but I tried this solution and it did not work for me.

The resulted screen can be seen from this link.

Thanks

Community
  • 1
  • 1
alpay
  • 16
  • 2

1 Answers1

0

It seems that you are calling detectAndDisplay directly wihtout using the same main function.

Just add Add cv::waitKey() at the end of the detectAndDisplay function.

Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
  • Thank you for your response but actually, I have tried this solution since [link](http://stackoverflow.com/questions/8894451/opencv-shows-gray-window) says that, but the screen is still gray :( – alpay Jan 21 '17 at 19:08
  • @alpay Did you exactly copy the code from the source without any edit? – Humam Helfawi Jan 21 '17 at 19:17
  • I exactly copied the code and run it as console application – alpay Jan 21 '17 at 20:32