Real time keypoint detection algorithm

692 views Asked by At

I need to measure the speed a conveyor belt under a surveillance camera. After years of wearing the belt is basically texture-less, it's even difficult to see whether the belt is moving if nothing is on top it.

I'm trying to solve this problem as an object tracking problem:

  1. Find some keypoints/objects on the belt.
  2. Track those keypoints/objects with OpenCV's median flow tracker.
  3. Inverse perspective transform and get the speed in 3D space.

If the keypoints/objects in step 1 are given manually, step 2 & 3 work very well, but I have performance issues finding keypoints automatically: keypoint detection costs 60ms+ even if I crop the images into very small ones. I tried SURF & ORB implemented in OpenCV, neither one is fast enough.

Are there any other faster options ?

1

There are 1 answers

1
Tides On

Maybe you can try the FAST algorithm for corner detection. It's faster than the options you have tried. It's implemented in opencv. Here's the sample code extracted directly from the opencv documentation (https://docs.opencv.org/master/df/d0c/tutorial_py_fast.html):

import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt

img = cv.imread('simple.jpg',0)

# Initiate FAST object with default values
fast = cv.FastFeatureDetector_create()

# find and draw the keypoints
kp = fast.detect(img,None)
img2 = cv.drawKeypoints(img, kp, None, color=(255,0,0))

# Print all default params
print( "Threshold: {}".format(fast.getThreshold()) )
print( "nonmaxSuppression:{}".format(fast.getNonmaxSuppression()) )
print( "neighborhood: {}".format(fast.getType()) )
print( "Total Keypoints with nonmaxSuppression: {}".format(len(kp)) )
cv.imwrite('fast_true.png',img2)

# Disable nonmaxSuppression
fast.setNonmaxSuppression(0)

kp = fast.detect(img,None)

print( "Total Keypoints without nonmaxSuppression: {}".format(len(kp)) )
img3 = cv.drawKeypoints(img, kp, None, color=(255,0,0))
cv.imwrite('fast_false.png',img3)