As the input, program would get a set of point (x,y), along with the time a certain point was drawn. (suppose on a tablet).
Let's restrict ourselves to simple polygons.
I implemented Hough transform, in polar coordinates.
Mapping points from (x,y)
space to curves (r,fi)
space.
P:(x,y)->(r,y), Re->Re^2
Define function F
F: (r,fi)->Re
which takes each point in (r,fi)
space and returns the number of intersecting curves at that point. Interpret the image of F as a surface in 3space, we construct a set E, containing its "peaks".
Problem: When the input is drawn, because of human error, lines are wavy. This causes scattered "peaks". Even when drawing one line, cases occur, where the maximum element of E, poorly approximates the general direction of the drawn line.
My ways of trying to fix it:
Firstly I tried to smooth out the input before the algorithm gets it.
- Point(i)=(Point(i-1)+Point(i)+Point(i+1))/3
-> by averaging
- I tried smoothing it out by gluing Besier curves, I took all the input points, and then treating each two neighbours as the boundary points of a Besier curve, and calculating the missing two. 2n by 2n system. The problem with this is that I should reduce the points for it to have effect.
-Currently I'm writing a Mean curvature flow implementation, to try to use it for smoothing
Two pictures. Black is Before Red is after