title: Adding GUI Window to python opencv2 program with pygtk3
body: <p>I have completed a program using Python and Opencv2. Now, I wants to add a GUI Window to my program. </p>
  
  <p>I am having some experience with PyGtk3. So, I modified my code to adopt with PyGtk3. But, I got errors. So, I tried a simple program to find out the actual mistake. </p>
  
  <p>My testing code is,</p>
  
  <pre><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()
  </code></pre>
  
  <p>Actually, program does not show any compile time error.  But after execute this program, when the flow reach that code <code>cv2.imshow('image',img)</code> program automatically terminates. </p>
  
  <p>If I comment <code>cv2.imshow('image',img")</code> only means this program works fine. But, I need to insert the code <code>cv2.imshow('image',img)</code>. </p>
  
  <p>Could you please help me to solve this problem... 
  <br><br>
  Thanks in advance... </p>
  
  <p><strong>Update</strong><br><br>
  I tried with Tkinter. I am able to show a Image but unable to show video. My testing code is</p>
  
  <pre><code>import numpy as np
  import cv2
  
  import Tkinter
  top = Tkinter.Tk()
  top.mainloop()
  
  cam = cv2.VideoCapture('dove1.mp4')
  # Structuring element
  es = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (9,4))
  
  t_minus = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
  t = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
  
  i = 1 
  while True:
      flag,frame = cam.read()
      rgb_image = frame
      if(flag==False):
          break
      print i
      i = i + 1
      cv2.imshow('RGB Image',frame);
  </code></pre>
  
  <p>Actually, <strong>I want to add a GUI window to my program.</strong> I am processing a input video file and displaying 4 levels of its output video. Its completed. GUI is problem. Can anyone help me to solve my problem please ?</p>