[JdeRobot] Showing video from camera interface in GTK using Python

Javii javifh91 at gmail.com
Tue Jun 2 17:53:59 CEST 2015


Hi all,

I am having a problem trying to show a video from a camera interface, i do
it this way:

def camera_thread (self):
    try:
      obj = ic.stringToProxy('cameraRGB:default -h '+self.Kinect[0]+' -p ' +
self.Kinect[1])
      kin = jderobot.CameraPrx.checkedCast(obj)
    except:
      print "Camera: Connection Failed"
      return

    while True:
      data = kin.getImageData(kin.getImageFormat()[0])
      pixbuf = GdkPixbuf.Pixbuf.new_from_data(data.pixelData,
GdkPixbuf.Colorspace.RGB, False, 8,
data.description.width,data.description.height,
data.description.width*3,None, None)
      Gdk.threads_enter()
      self.CamImage.set_from_pixbuf(pixbuf)
      Gdk.threads_leave()


I get the ImageData and i transform it to a pixbuf to show it in a
Gtk.Image. The video works and i can see it, but something like a black
blink happens and its a little ugly. I read other components like cameraview
and rgbdViewer and they use cameraClient but i think that in python it is
not able.

How can i improve it?

I recorded this video of what happens, in this video the blink is very huge,
when i dont record the windows it is softer.

https://www.youtube.com/watch?v=grAJvhJEfhA




--
View this message in context: http://jderobot-developer-list.2315034.n4.nabble.com/Showing-video-from-camera-interface-in-GTK-using-Python-tp4642699.html
Sent from the Jderobot Developer List mailing list archive at Nabble.com.


More information about the Jde-developers mailing list