How to detect users’ freehand drawing to primitive geometrical objects like square, circle, triangle [closed]

爱⌒轻易说出口 提交于 2020-01-16 04:22:07

问题


I am currently looking for some guide/samples on how to implement the OS X Yosemite’s markup like features. i.e., auto detecting/guess freehand drawing to match users’ intention of whether they are trying to draw circle, square, or triangle.

Please refer the image below, the left side represents the users freehand drawing and the right is auto-detected shapes replaced by OS X markup.


回答1:


Recognizing objects from gestures is a subject of ongoing research. There is a class of algorithms called "$ recognizers" that you might want to look at. The original algorithm is "The $1 Recognizer" which is worth a read.

It is not that difficult to implement such recognizers, as long as you are limited to a specific class of shapes. The $1 recognizer (if I recall correctly) only works for a continuous path (so "X" would not work because it requires two strokes). However, later work has extended the $1 recognizer for non-continuous cases.



来源:https://stackoverflow.com/questions/31370054/how-to-detect-users-freehand-drawing-to-primitive-geometrical-objects-like-squa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!