在iphone上绘图
我正在尝试为儿童开发一个iPhone应用程序,它可以通过触摸在屏幕上绘制字符,我想知道如何匹配字母表中良好字符所绘制的字符。我将如何比较两种形状(绘图和现有)
任何想法?
一些代码?
I am trying to develop an iPhone application for children which will be able to draw characters on screen with touch and I want to know how to match the character drawn with good character of the alphabet. How will i compare the two shapes (drawing and existing) Any idea?? some code?
使用GLGestureRecognizer ,您可以创建目录,它将计算输入点数组与您预定义的字母之间的度量。
Using GLGestureRecognizer you can create a catalogue and it will compute a metric between an input point array against an "alphabet" you predefine.
GLGestureRecognizer是$ 1 Unistroke
识别器的Objective-C
实现,一个简单的手势
识别算法(参见下面的Credits
)。它以
的形式提供给iPhone应用程序
项目。这是在Adam Preble于2009年4月晚些时候在
晚上的
课程中实施的。
GLGestureRecognizer is an Objective-C implementation of the $1 Unistroke Recognizer, a simple gesture recognition algorithm (see Credits below). It is made available here in the form of an iPhone application project. It was implemented over the course of a couple evenings in late April 2009 by Adam Preble.
一个演示iPhone项目
(提供Gestures.xcodeproj);
UIView子类接收触摸事件
并将它们发送到
GLGestureRecognizer类,而
将触摸路径绘制为白色。
手势完成后,
重采样手势显示为绿色,
显示为红点中心,以及
最佳匹配名称,得分
(越低越好),手势
方向。示例中使用了16
点的样本大小,对于非常基本的
形状,
似乎已足够。
A demo iPhone project (Gestures.xcodeproj) is provided; a UIView subclass receives touch events and sends them to the GLGestureRecognizer class while drawing the touched path in white. Once the gesture is completed, the resampled gesture is shown in green, its center at the red dot, along with the name of the best match, score (lower is better), and gesture orientation. A sample size of 16 points is used in the example, which seems to be adequate for very basic shapes.