test05_features_video.py
Go to the documentation of this file.
00001 import roslib; roslib.load_manifest('hai_sandbox')
00002 from cv_bridge.cv_bridge import CvBridge, CvBridgeError
00003 import cv
00004 import sys
00005 import hrl_lib.rutils as ru
00006 import hai_sandbox.features as fea
00007 
00008 forearm_cam_l = '/l_forearm_cam/image_rect_color'
00009 ws_l = '/wide_stereo/left/image_rect_color'
00010 ws_r = '/wide_stereo/right/image_rect_color'
00011 
00012 fname = sys.argv[1]
00013 bridge = CvBridge()
00014 
00015 cv.NamedWindow('surf', 1)
00016 cv.NamedWindow('harris', 1)
00017 cv.NamedWindow('star', 1)
00018 
00019 for topic, msg, t in ru.bag_iter(fname, [ws_l]):
00020     image = bridge.imgmsg_to_cv(msg, 'bgr8')
00021     image_gray = fea.grayscale(image)
00022 
00023     surf_keypoints, surf_descriptors = fea.surf(image_gray)
00024     cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))
00025 
00026     harris_keypoints = fea.harris(image_gray)
00027     cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0)))
00028 
00029     cv.WaitKey(10)
00030     


hai_sandbox
Author(s): Hai Nguyen
autogenerated on Wed Nov 27 2013 11:46:56