在 iPhone 上画画 [英] drawing on iphone

查看:17
本文介绍了在 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 是一个 Objective-C1 美元 Unistroke 的实施识别器,一个简单的手势识别算法(见Credits以下).它在此处提供iPhone应用程序的形式项目.它是在几个晚上的课程2009 年 4 月,Adam Preble.

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.

这篇关于在 iPhone 上画画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆