#! /usr/bin/env python
# -*- coding:utf-8 -*-


#
# Show the images from a USB camera
#


#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vtk


#
# Main application
#
if __name__ == '__main__' :

    application = QtGui.QApplication( sys.argv )
    widget = vtk.UsbCameraWidget()
    widget.show()
    sys.exit( application.exec_() )

@@ -111,16 +111,17 @@
 ncies%0A#%0A
+#
 import s
@@ -123,16 +123,28 @@
 ort sys%0A
+import cv2%0A#
 from PyS
@@ -186,17 +186,149 @@
 it as vt
-k
+%0A%0A%0A#%0A# Image callback function%0A#%0Adef Callback( image ) :%0A%09#%C2%A0Display the stereo image%0A%09cv2.imshow( 'Camera', image )%0A%09cv2.waitKey( 1 )
 %0A%0A%0A#%0A# M
@@ -374,16 +374,17 @@
 n__' :%0A%0A
+#
     appl
@@ -424,16 +424,17 @@
 .argv )%0A
+#
     widg
@@ -440,17 +440,16 @@
 get = vt
-k
 .UsbCame
@@ -459,16 +459,17 @@
 idget()%0A
+#
     widg
@@ -478,16 +478,17 @@
 .show()%0A
+#
     sys.
@@ -515,8 +515,531 @@
 ec_() )%0A
+%0A%09# Initialize the stereo cameras%0A%09usbcamera = vt.UsbCamera( Callback )%0A%09# Lower the camera frame rate and resolution%0A%09usbcamera.camera.set( cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640 )%0A%09usbcamera.camera.set( cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 480 )%0A%09usbcamera.camera.set( cv2.cv.CV_CAP_PROP_FPS, 25 )%0A%09#%C2%A0Start capture%0A%09usbcamera.start()%0A%09# Wait for user key press%0A%09raw_input( 'Press %3Center%3E to stop the capture...' )%0A%09# Stop image acquisition%0A%09usbcamera.running = False%0A%09usbcamera.join()%0A%09# Cleanup OpenCV%0A%09cv2.destroyAllWindows()%0A

Add OpenCV viewer for debug.