Skip to content

icorner.m - Issue on the implementation of 'suppress' option #4

@petercorke

Description

@petercorke

eported by [email protected], Feb 2, 2014
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions