I am not sure this is the right place, but it is a math problem too so let me give it a shot. This problem comes from Robotics but can be totally extricated from there.
In brief, we have a set of points $(x,y)$ on a plane of specific dimension.. (They happen to be points where a sensor has determined there is an obstacle. In reality the obstacles are just straight walls at right angles with each other.)
We want to convert that into a list of lines which are formed by the points. Intuitively if you look at the dots on a screen it's usually quite clear where to draw the lines. Look at this image which as many points. It's sort of obvious where the line segments are (mostly.)
The algorithm we are using is a Hough transform and we admit that we are not experts in it. We've tweaked the parameters as best we can.
For the input image above it gives us 100-200 lines segments. In "reality" there are maybe 20-30.
Basically this is a function that takes a list of $(x,y)$ pairs and generates a new list of $(x_1,y_1,x_2,y_2)$ line segments.
Does anyone have experience with this or refer me somewhere else to look? Thanks!
Pito

With the Hough transform obtained in a python repository we obtain a good result. Here
wmH1C.pngis the furnished picture.After processing