Go to the documentation of this file.00001 import roslib; roslib.load_manifest('hai_sandbox')
00002 import cv
00003 import sys
00004 import hai_sandbox.features as fea
00005
00006 if __name__ == '__main__':
00007 fname = sys.argv[1]
00008 image = cv.LoadImage(fname)
00009 image_gray = cv.CreateImage((640,480), cv.IPL_DEPTH_8U,1)
00010 cv.CvtColor(image, image_gray, cv.CV_BGR2GRAY)
00011
00012 star_keypoints = fea.star(image)
00013 surf_keypoints, surf_descriptors = fea.surf(image_gray)
00014 harris_keypoints = fea.harris(image_gray)
00015
00016 cv.NamedWindow('surf', 1)
00017 cv.NamedWindow('harris', 1)
00018 cv.NamedWindow('star', 1)
00019 while True:
00020 cv.ShowImage('surf', fea.draw_surf(image, surf_keypoints, (255, 0, 0)))
00021 cv.ShowImage('harris', fea.draw_harris(image, harris_keypoints, (0, 255, 0)))
00022 cv.ShowImage('star', fea.draw_star(image, star_keypoints, (0, 0, 255)))
00023 k = cv.WaitKey(33)
00024 if k == 27:
00025 break
00026
00027