Reg : Problem with Python Opencv and Gtk

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Reg : Problem with Python Opencv and Gtk

Thamizh
Hi,
I wrote a code with python opencv2 and it works fine. I wants to add GUI Window to my program. So, I tried to attach my code with Pygtk. Its too works fine. But, opencv cv2.imshow() function not run. 

Actual Code:-

import pygtk
pygtk.require('2.0')
import gtk
import numpy as np
import cv2

builder = gtk.Builder()
builder.add_from_file("GUI.glade")
window = builder.get_object("window1")
window.set_title("Single Object Tracking")
window.connect("delete-event", gtk.main_quit)
window.show_all()    
img = cv2.imread('Birds.jpg')
cv2.imwrite('abcdefgh.png',img)
cv2.imshow('image',img)
cv2.waitKey(10000)
cv2.destroyAllWindows()
gtk.main()


Actually, program does not show any compile time error.  But after execute this program, when the flow reach that code "cv2.imshow('image',img)" program automatically terminates. If I comment "cv2.imshow('image',img") only means this program works fine. But, I need to insert the code "cv2.imshow('image',img)". Could you please me to solve this problem... 

Thanks in advance...



_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

check2.py (598 bytes) Download Attachment
GUI.glade (8K) Download Attachment