Best-fit algorithm to fit a set of lines onto a polygon -
i have 2 sets of lines, set , b. start , end points of lines in these 2 sets known , want find rotation , translation best fits set b onto set a. there no scaling:

- there not one-to-one mapping. believe rules out kabsch algorithm, though can envisage brute force algorithm uses this.
- set b contain partial segments of lines in a. contain pretty sparse number of lines.
- the lines in b erroneous - there may lines observed not exist in a.
- there may, of course, more 1 possible 'matches'
for background, part of crude image-based robot positioning system.
- set 'map' - data imported imported dxf file.
- set b set 1 observed lines.
i've had around, example here:
how align shapes together? (geometrical best-fit algorithm)
is clever way of doing this? flicking through image-processing literature shape-matching seems more pattern matching raster images - overkill perhaps problem.
the best way can perceive @ moment use hough transform-like approach taking each line in b along each line in , having bins rotation/transformations these represent. have not coded , tried out yet - kind of wanted avoid reinventing wheel.
any ideas , input appreciated.
a general solution extract "features" set , comparing features set b.
one example: consider unique angles in set , calculate different unique pairs of angles. in example set there 3 possible cases: (0,0), (0,90), (90,0). sort angles of lines in set b , match pairs set a. example: if angles 0,5,50,93,129, lines angles (0,5), (0,93), (5,93), (50, 129) matching candidates. once have candidates can further filter them.
depending on type of lines have in set a, can extract relevant features. example: if lines perpendicular or parallel, can have features distance between lines.
Comments
Post a Comment