I'm trying to write an algorithm to extract segment from laser data, loaded into a CSimplePointsMap object, so I work with points in Carthesian coordinates, but it's not simple to recognize correctly a segment and store it into a TSegment2D object. In mrpt there is a method for lines extraction (ransac_detect_2D_lines) but from lines it's hard to extract the original segment.
How should i proceed? Is there an algorithm you can suggest me?
Thanks for the assistance