File Exchange

image thumbnail

A Corner Detector based on Global and Local Curvature Properties

version (2.75 MB) by Xiaochen He
A robust corner detector works on grey-level images as well as planar curves.


Updated 19 May 2009

View License

CORNER works by the following step:
1. Apply the Canny edge detector to the grey level image and obtain a binary edge-map.
2. Extract the edge contours from the edge-map, fill the gaps in the contours.
3. Compute curvature at a low scale for each contour to retain all true corners.All of the curvature local maxima are considered as initial corner candidates.
4. Initial corner candidates are compared using an adaptive local threshold to remove the round corners.
5. The angles of corner candidates are evaluated to eliminate any false corners due to quantization noise and trivial details. The above evaluation is based on a dynamic region of support, which changes according to its adjacent corner candidates.
6. End points of contours are considered with an additional criterion.

Algorithm is derived from:
X.C. He and N.H.C. Yung, "Curvature Scale Space Corner Detector with Adaptive Threshold and Dynamic Region of Support", Proceedings of the 17th International Conference on Pattern Recognition, 2:791-794, August 2004.

Improved algorithm of above has been published in:
X.C. He and N.H.C. Yung, “Corner detector based on global and local curvature properties”, Optical Engineering, 47(5), pp: 057008, 2008. (This paper is included in corner.rar for reference)

Comments and Ratings (41)


zq (view profile)

Polina Sh


viviek (view profile)

jarrar manel

code plz

Output argument "curve" (and maybe others) not assigned during call to
% Extract curves


Hg (view profile)

do you also implement it on C++ or opencv?

Shasha Glow

Can i get the code... just for reference..


Meng (view profile)

Very usefull


CHARFI (view profile)

does anyone have the matlab source code of the Rosenfeld method for corner detection? or how to find it? PLEASE!


Winnie (view profile)

Can anyone tell me how to call this function? What is the parameter(s) to be passed to this function? PLS HELP!


Winnie (view profile)


Thanks..was very useful great work...


Lili (view profile)

mercy jesu

good it was very much useful to me....


sanjay (view profile)


to avoid the failure set Endpoint = 0;


If the corner detector doesnt find any corners in the image, a failure occures:
"Error using ==> minus
Matrix dimensions must agree.

Error in ==> corner>get_corner at 291
compare_corner=cout-ones(size(cout,1), 1)*curve_start(i,:);"

anand mishra

why higher sigma value some time gives more corner? can any one explain me.


Jozs (view profile)


hbu  (view profile)

good ,thank you very much!

liu YY

Suvdaa B

Thank you very much.
Good luck for your research work.

minde min daugelis

z lijie

thank you very much!

Somaya Mostafa

Good code for making edge and corner detection

Nat Ang

Good code, works fine. Just a little addition...if the image (like in some of my cases) does not have corners the program produces an error...solved by adding in the function get_corner another conditional in the last if...
if count,
if Endpoint,....

Other than that it's perfect. The error was generated when evaluating segments of ellipsoids and looking for corners in the edges to identify overlapping ellipses.
If the segment did not have corners neither was closes (a full ellipse) then the error was generated....this is for general information it might be useful for someone!.


Jonathan Perilla

rainer martin

good work and thansk for this publication

Nan Jiang

The flip on retrieving zero-crossing point is smart.
In Fit a circle step, what (x0, y0) suppose to mean? I guess it the center of the fitted circle? Am I right?

Daniel Daniel

Xiaochen He

Reply to ming cui's comments: the multiscale tracing is not a step of my corner detector. It is adopted by CSS corner detector, which was referenced in my ICPR paper.

gorkem serbes

It works perfect, nice job.

ming cui

Well ,the result is pretty good, but the author did not do the multiscale tracing, claimed as step 5 & 6 in his icpr paper. If this programmme is used to prove the paper, then it's kind of incomplete.

Don M

Excellent job. Code works as perfect. Thank you for your great work!

abu bakar elmi

I had tried and it work great.

Mohammad Awrangjeb

simply gr8!

Zhigang Tan

it integrates both local and global information to determine a salient corner. Just behave as a multi-scale corner detector. Really great work! Though better mathematical explanation would reputate it.

Shripad Kondra

Simply gr8 ! This is a nice algorithm, easy to understand, specially for newbies in contour tracing

Youn Kim

I like the "extract_curve" function in this code.

Itachi Uchiha

Great work! I've tried many corner detectors (Harris-Plessey, SUSAN, Kitchen/Rosenfeld...) and this one gives the best results. Highly recommended!


1. BSD license assigned
2. Newly published paper based on this code is included for reference

Fix some small bugs, and add information that the paper related to this algorithm has been submitted to Pattern Recognition.

Add information that the paper related to this algorithm has been submitted to IEEE Transaction on Image Processing

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor