Ideal algorithm for real-time helipad tracking?

asked 2018-02-08 22:52:33 -0600

hw_gn gravatar image

Dear all,

I've been testing numerous methods for helipad tracking (H in a circle) but none seems to be ideal for the task.
Appreciate anyone who could enlighten me on a reliable approach for tracking such an object, or any way to improve my current ORB parameters.

What I tried:

1. Colour + Contour Finding: Works most of the time with a downward facing camera but prone to environmental noise giving false contour matches (finding a shape with 12 edges), not exactly skew invariant since some edges disappears at an angle.

2. ORB/SIFT: Too many false positive matches due to the generic shape of the landing pad.

MIN_MATCH_COUNT = 10
img1 = cv2.imread('helipad.jpg',0)
img2 = gray
orb = cv2.ORB_create()
kp1, des1 = orb.detectAndCompute(img1,None)
kp2, des2 = orb.detectAndCompute(img2,None)

bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
matches = bf.match(des1,des2)
dmatches = sorted(matches, key = lambda x:x.distance)

src_pts  = np.float32([kp1[m.queryIdx].pt for m in dmatches]).reshape(-1,1,2)
dst_pts  = np.float32([kp2[m.trainIdx].pt for m in dmatches]).reshape(-1,1,2)

M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)
h,w = img1.shape[:2]
pts = np.float32([ [0,0],[0,h-1],[w-1,h-1],[w-1,0] ]).reshape(-1,1,2)
dst = cv2.perspectiveTransform(pts,M)

img2 = cv2.polylines(img2, [np.int32(dst)], True, (0,0,255), 1, cv2.LINE_AA)
cv2.imshow("Tracker", img2)
res = cv2.drawMatches(img1, kp1, img2, kp2, dmatches[:20],None,flags=2)
cv2.imshow("Match", res)
edit retag flag offensive close merge delete

Comments

by the way 2 is not "numerous " :P

Balaji R gravatar imageBalaji R ( 2018-02-08 23:05:03 -0600 )edit

@BalajiR Ahah good point sir, there were a few other variants of feature extraction that I tested but I'd consider them under the same umbrella (SURF, BRIEF, etc) that uses bruteforce or flann based matcher. Am also constrained to using said marker, otherwise Acuro would've been a fit. HAAR yields false positives as well.

hw_gn gravatar imagehw_gn ( 2018-02-09 00:34:47 -0600 )edit

@hw_gn, I'm working on the same task, im using SURF algorithm. Due to the helipad texture, it might be possible to more false positives. I think its better to have a custom helipad with rich texture which has more features to be detected in the image.

komms gravatar imagekomms ( 2018-03-17 12:15:34 -0600 )edit