3 ms·
I did not understand your Q1 for Q2: Identifying sequence of lines vs identifying bezier curve was toughest problem for me.
by rajeevk 14y ago
I did not understand your Q1
for Q2: Identifying sequence of lines vs identifying bezier curve was toughest problem for me.
- denzil_correa 14y agoQ1: What algorithm do you use to identify the nearest shape? How do you know the user intends to draw a square, or a curve or a rectangle?
- rajeevk 14y agoWhen user completes a stroke (touch up), then I take the path drawn by user, then divide the path such that each small sub path is very close to a line. Then I have combination of lines, Suppose I have four lines, then possibilities are that it can be a quadrilateral or circle, (if the end of last line is close to the start of the first line), then I use variance to determine which shape closely fits to the drawn stroke. Once I know if this is quadrilateral, then uses various heuristics to find out if it is close to a rectangle or parallelogram etc.