Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't show image display windows in openCV

I am using openCV python bindings. I am trying to show the output image using the following listing:

cv.NamedWindow('display')
cv.MoveWindow('display', 10, 10)
cv.ShowImage('display', cvImage)

But I do not see any window.

My platform is Linux (openSuse 11.4), python-opencv version 2.1 and python 2.7.

like image 334
Xolve Avatar asked Jun 03 '11 09:06

Xolve


1 Answers

You need to call the WaitKey function to process the events. Check out the documentation: http://opencv.willowgarage.com/documentation/python/highgui_user_interface.html#waitkey

This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing, unless HighGUI is used within some environment that takes care of event processing.

Just add a WaitKey(0) at the end of your code and it should work just fine.

like image 83
susmits Avatar answered Nov 15 '22 03:11

susmits