HELP...How to detect corners using Harris corner detection Algorithm?

17 views (last 30 days)
Hi, I am having trouble with getting this corner detection code to work properly. It works fine but points are scattered all over the place, i want the corner points to be detected within the bounding box. is there anything i need to add or edit?
This is the code i have so far:-
faceDetector = vision.CascadeObjectDetector('FrontalFaceCART');
cornerDetector = vision.CornerDetector('Method','Harris corner detection (Harris & Stephens)');
bboxes = step(faceDetector, Irgb2gray);
corners = detectHarrisFeatures(Irgb2gray);
Irgb2gray = insertObjectAnnotation(Iface, 'rectangle', bboxes, 'Face');
figure, imshow(Irgb2gray), title('Detected faces'); hold on;
Thank you in advance.
Anand on 17 Nov 2013
Any suggestions on how to approach this problem? as you can see from the image below the 50 strongest points are not detected inside the bounding box.

Sign in to comment.

Accepted Answer

Anand on 17 Nov 2013
Try the syntax with the 'ROI' parameter, something like this:
corners = detectHarrisFeatures(Irgb2gray,'ROI',bboxes(1,:));
This will detect Harris corners within the first bounding box in bboxes.
Anand on 21 Nov 2013
so this is the code for it:-
for i = 1 : size(mouth,1)
corners = detectHarrisFeatures(rgb2gray(I),'ROI',faces(i,:),'MinQuality',0.05);
hold on;
hold off;

Sign in to comment.

More Answers (0)


Find more on Computer Vision Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!