S.U.R.F.

2 May

Speed Up Robust Feature extraction algorithm. For those who all are hearing this algorithm for the first time please visit wiki and understand a bit about it.

Now, from name you can guess its something about features. Here I am gonna tell you about its implementation.The following is the code in python using Opencv.

############################################################

import cv2

cap = cv2.VideoCapture(0)
ret,img = cap.read()
#im2 = cv2.imread(‘ex1.jpg’)
#im = cv2.cvtColor(im2,cv2.COLOR_BGR2GRAY)
while True:
ret,img = cap.read()
im= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
surfDetector = cv2.FeatureDetector_create(“SURF”)
surf = cv2.DescriptorExtractor_create(“SURF”)
keypoints = surfDetector.detect(im)
(l,d)= surf.compute(im,keypoints)

for kp in l:
x = int(kp.pt[0])
y = int(kp.pt[1])
cv2.circle(im,(x,y),2,(0,0,255))

cv2.imshow(“features”,im)
cv2.waitKey(1)

#############################################################

Advertisements

One Response to “S.U.R.F.”

  1. Khuram Ali May 6, 2013 at 11:36 am #

    Reblogged this on Khuram Ali.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: