ustczd / matlab-toolboxes-robotics-vision

Automatically exported from code.google.com/p/matlab-toolboxes-robotics-vision
0 stars 0 forks source link

File: icorner.m - Issue on the implementation of 'suppress' option #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. b1 = iread('building2-1.png','grey','double');
2. C1 = icorner(b1, 'nfeat', 200);
3. C2 = icorner(b1, 'nfeat', 200, 'suppress', 20);

What is the expected output? What do you see instead?
For the first call of "icorner" it should return the first 200 strongest 
corners.
For the second call it should return the first 200 strongest corners that do 
not overlap regarding a circle with the radius of 20 pixels. (the corner should 
be more dispersed in the output image).
But, both calls return exactly the same first 200 strongest corners.   

What version of the product are you using? On what operating system?
Vision-3.3, Windows 8.1 x64, and Matlab R2012a

Please provide any additional information below.
Reviewing the "icorner" source code I found the problem:
line 280: d = sqrt( sum((features.v'-y).^2 + (features.u'-x).^2) );
This line compute the sum of the distances between current corner and the 
corners already saved on the solution. In this case "d" is a scalar. 
But, we need to compute the individual distances between the current corner and 
each corner part of the solution. In this case "d" it will be an array. 
Regarding to the minimum value from "d", we can take a decision if we keep the 
corner or not.
Fix: d = sqrt((features.v'-y).^2 + (features.u'-x).^2); 
Because of this modification, we need to do one more thing: add a new index to 
the loop. We already have one for parsing the list of corners (which in the 
current implementation is "i"), and we need one more for the output array.
We need to keep increasing "i" on each iteration, but "j" (the second index) 
only if we keep the current corner.(is part of the solution)
Attached to this report, is also the icorner.m modified file.

Best Regards,
Andrei

Original issue reported on code.google.com by cos...@live.com on 2 Feb 2014 at 9:47

Attachments: