File Exchange

image thumbnail

Feature points in image, Keypoint extraction

version 1.1 (1.18 MB) by

Finds, matches, plots feature points in images.

4.66667
7 Ratings

38 Downloads

Updated

View License

Feature points (read corners) in images are points that invariant under view changes, zoom, lightening conditions etc.

These code has been written as part of the project I have performed in image processing course some time ago.
The code should (hopefully) be easily readable since it has been well commented, with report for background information and additional explanation.
Hope it will be useful for students entering the image processing field.
Implemented a SIFT like descriptor, as well as ASIFT (http://www.cmap.polytechnique.fr/~yu/research/ASIFT/demo.html).
Shortly about ASIFT - simulates view changes of images, for each such view finds FPs followed by descriptor calculation for future matching. It is slow and intended for studying purposes. Quick C++ implementation is available at the authors aforementioned ASIFT-project page.

There are a lot of options, parameters to control every step of calculations. Try to play with it: the performance may vary drastically.

Used pdist2.m code from Piotr's Toolbox
http://vision.ucsd.edu/~pdollar/toolbox/doc/
as well k nearest neighbors from Matlab exchange server, author of which I can't find now.

Comments and Ratings (21)

frust frust

frust frust

here some tips, i dont know whether it is ok ,to make sure of them
%------------------ Derivative mask -------------------%
x = -round(3*S_D):round(3*S_D);
dx = -x .* exp(-x.*x/(2*S_D*S_D)) ./ (S_D*S_D*S_D*sqrt(2*pi));
here these codes from document named "harrispls.m"
i wannt to make sure that S_D^3*sqrt(2pi) is ok ,and not S_D^2*sqrt(2pi)

Yiyu Hong

hi
I want to use the key points detected to calculate thier motion vectors (optical flow

Ömer KAYA

Hello All,

I am a beginner in Feature Point Extraction,

so does this program has one script that I can run?

Thanks in advance

Waqas Khan

Undefined function 'harrislpls' for input arguments of type 'uint8'.

Error in demoSIFT (line 60)
[ HrLPoints1 ] = harrislpls( img1gr, TypeOfNBHOOD, NBHOOD, TypeOfCornerDetector,
BorderDistance, ThreshType, HarrisThresh, k, Dilate, radius, sigma_nmbr, dispPlaces,
SwitchWaitbars );

sara

sara (view profile)

hi dear Keypoint Extraction
I am beginner. can you explain how can I run this code?

Hi all, please i need your help I'm trying to implement ASIFT algorithm by using this code but I'm getting this error every time i implement the code "
error in ===>demoASIFT
Error using disp
Too many output arguments.

Error in main (line 99)
[ HrLPointsTmp1 ] = harrislpls( imgSimulated,
TypeOfNBHOOD, NBHOOD, TypeOfCornerDetector,
BorderDistanceMatrix, ThreshType, HarrisThresh,
k, Dilate, radius, sigma_nmbr, disp,
SwitchWaitbars );

Artiom Kovnatsky

Dear all,
I fixed the errors: now it should work smoothly.
Let me know if you have any problems.
Regards,
Art.

sindhu

sindhu (view profile)

Help!! Unable to run the code. Getting this error.

Undefined function or method 'harrislpls' for input arguments of
type 'uint8'.

Error in ==> demoSIFT at 64
[ HrLPoints1 ] = harrislpls( img1gr, TypeOfNBHOOD, NBHOOD,
TypeOfCornerDetector, BorderDistance, ThreshType, HarrisThresh, k,
Dilate, radius, sigma_nmbr, dispPlaces, SwitchWaitbars );

Haris

Haris (view profile)

Iam unable to run both the codes. Kindly help me to run the codes.
In first code (demosift.m) it shows error
"harrispls" is not working for integer type of form unit8"

in second code (demoasift.m) it shows error:
Error using disp
Too many output arguments.
Error in demoASIFT (line 109)
[ HrLPointsTmp1 ] = harrislpls( imgSimulated, TypeOfNBHOOD, NBHOOD,
TypeOfCornerDetector, BorderDistanceMatrix, ThreshType, HarrisThresh, k, Dilate,
radius, sigma_nmbr, disp, SwitchWaitbars );

Kindly someone tell me the problem in this..I'll be really really obliged..

I have 2 doubts:

#1: I am using demoSIFT.m (on Windows)
img1: https://www.dropbox.com/s/q4p9df8dabtw6dr/img1.png?dl=0
and
img2: https://www.dropbox.com/s/6ifab90c9hl0ptv/img2.png?dl=0

I am pretty sure I am getting what I want, matching features. But I am not able to view the output clearly on my screen (both images together side by side showing matched features). The screen shot of my output is here: https://www.dropbox.com/s/4hruxm676evva8m/Output_screenshot.png?dl=0.
What parameter should I change?

#2: I am not able to run demoASIFT.m (with same images as input) Error message is:
>> demoASIFT
Error using disp
Too many output arguments.

Error in demoASIFT (line 109)
[ HrLPointsTmp1 ] = harrislpls( imgSimulated, TypeOfNBHOOD, NBHOOD,
TypeOfCornerDetector, BorderDistanceMatrix, ThreshType, HarrisThresh, k, Dilate,
radius, sigma_nmbr, disp, SwitchWaitbars );

What am I doing wrong?

Thank-you

@risky: you can run the demo .m files within the folder "Demos, scripts".
First feed img1 and img2. (img1 = imread(....); img2 = imread(...)).
Open the demo .m file and click on F5.

risky

risky (view profile)

hay im new to matlab, can you tell me how to run the code ??

Joyce

Joyce (view profile)

Hi,
why HrLOrntPoints and HrLPoints have different rows? Should HrLOrntPoints has same number with HrLPoints only one column added?

Artiom Kovnatsky

Hi,
The problem with d2Fdxdy has been fixed, now d2Fdxdy = [ 1 0 -1; 0 0 0; -1 0 1 ]/4

Artiom

Indraneel Biswas

thank you for the great code.
however, there is a small bug in Findlclmxm.m
derivative mask d2Fdxdy = [ 1 0 -1; 0 0 0; -1 0 -1 ]/4 is not correct.

Ferad

Ferad (view profile)

Very useful! There is some obsolete functions such as isrgb. A solution was to directly remove then an follow the code path for True.

fastidious

hi!!!
I found your code very interesting, but it gave the following error...
??? Error using ==> minus
Matrix dimensions must agree.

Error in ==> Findlclmxm at 83
rowSPA = row - RowDeltaY( ind2 );

Error in ==> harrislpls at 80
[ row, clmn, rowSPA, clmnSPA, MxMtr ] = Findlclmxm(HrF, NBHOOD,
BorderDistance, ThreshType, HarrisThresh );

Error in ==> demoSIFT at 59
[ HrLPoints1 ] = harrislpls( img1gr, TypeOfNBHOOD, NBHOOD,
TypeOfCornerDetector, BorderDistance, ThreshType, HarrisThresh, k, Dilate,
radius, sigma_nmbr, dispPlaces, SwitchWaitbars );

Artiom Kovnatsky

Hi,
yes, u right, need to be what u've written.
I'll change it.
Thank you.
:)

bin yao

I have a question. In Findlclmxm.m, there is d2Fdxdy = [ 1 0 -1; 0 0 0; -1 0 -1 ]/4;

I think it should be [1 0 -1; 0 0 0; -1 0 1] ?

Updates

1.1

- fixed bug in code (the one noticed by the users)
- description

MATLAB Release
MATLAB 7.6 (R2008a)
Acknowledgements

Inspired by: Keypoint Extraction

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video