Here's an implementation of the Harris Corner Detector algorithm in MATLAB:
main.m617 chars27 lines
The function takes in an input image I
, a scale factor k
, and a threshold thresh
for the corner response R
. It first converts the input image to grayscale if it's in RGB format. It then computes the gradient of the image, the products of the derivatives, and the sums of the products of derivatives for each pixel using convolution. Finally, it computes the Harris corner response R
based on these intermediate computations and applies a threshold to obtain the final corner locations in the logical image L
.
gistlibby LogSnag