资源简介
Java的一个简单手势识别程序,可以识别简单的字母和数字。

代码片段和文件信息
package wz.cs.szu.edu;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
/**
* Java Neural Network Example
* Handwriting Recognition
*/
public class Entry extends JPanel {
/**
* The image that the user is drawing into.
*/
protected Image entryImage;
/**
* A graphics handle to the image that the
* user is drawing into.
*/
protected Graphics entryGraphics;
/**
* The last x that the user was drawing at.
*/
protected int lastX = -1;
/**
* The last y that the user was drawing at.
*/
protected int lastY = -1;
/**
* The down sample component used with this
* component.
*/
protected Sample sample;
/**
* Specifies the left boundary of the cropping
* rectangle.
*/
protected int downSampleLeft;
/**
* Specifies the right boundary of the cropping
* rectangle.
*/
protected int downSampleRight;
/**
* Specifies the top boundary of the cropping
* rectangle.
*/
protected int downSampleTop;
/**
* Specifies the bottom boundary of the cropping
* rectangle.
*/
protected int downSampleBottom;
/**
* The downsample ratio for x.
*/
protected double ratioX;
/**
* The downsample ratio for y
*/
protected double ratioY;
/**
* The pixel map of what the user has drawn.
* Used to downsample it.
*/
protected int pixelMap[];
/**
* The constructor.
*/
Entry()
{
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK|
AWTEvent.MOUSE_EVENT_MASK|
AWTEvent.COMPONENT_EVENT_MASK);
}
/**
* Setup the internal image that the user
* draws onto.
*/
protected void initImage()
{
entryImage = createImage(200200);
entryGraphics = entryImage.getGraphics();
entryGraphics.setColor(Color.white);
entryGraphics.fillRect(00entryImage.getWidth(this)entryImage.getHeight(this));
}
/**
* Paint the drawn image and cropping box
* (if active).
*
* @param g The graphics context
*/
public void paint(Graphics g)
{
if ( entryImage==null )
initImage();
g.drawImage(entryImage00this);
g.setColor(Color.black);
g.drawRect(00entryImage.getWidth(this)entryImage.getHeight(this));
g.setColor(Color.red);
g.drawRect(downSampleLeft
downSampleTop
downSampleRight-downSampleLeft
downSampleBottom-downSampleTop);
}
/**
* Process messages.
*
* @param e The event.
*/
protected void processMouseEvent(MouseEvent e)
{
if ( e.getID()!=MouseEvent.MOUSE_PRESSED )
return;
lastX = e.getX();
lastY = e.getY();
}
/**
* Process messages.
*
* @param e The event.
*/
protected void processMouseMotionEvent(MouseEvent e)
{
if ( e.getID()!=MouseEvent.MO
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 232 2012-05-23 14:00 SOM_OCR\.classpath
文件 383 2012-05-23 14:00 SOM_OCR\.project
文件 4811 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\Entry.class
文件 7547 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\KohonenNetwork.class
文件 1411 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\MainEntry$SymAction.class
文件 974 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\MainEntry$SymListSelection.class
文件 1070 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\MainEntry$UpdateStats.class
文件 13462 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\MainEntry.class
文件 2656 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\Network.class
文件 1526 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\Sample.class
文件 1132 2012-05-25 14:48 SOM_OCR\bin\wz\cs\szu\edu\sample.dat
文件 1924 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\SampleData.class
文件 2940 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu\TrainingSet.class
文件 11639 2012-05-23 22:58 SOM_OCR\hs_err_pid2992.log
文件 4981 2012-05-23 22:58 SOM_OCR\hs_err_pid7924.log
文件 7906 2012-05-23 22:05 SOM_OCR\src\wz\cs\szu\edu\Entry.java
文件 13361 2012-05-25 11:59 SOM_OCR\src\wz\cs\szu\edu\KohonenNetwork.java
文件 17783 2012-05-25 14:45 SOM_OCR\src\wz\cs\szu\edu\MainEntry.java
文件 3770 2012-05-24 18:48 SOM_OCR\src\wz\cs\szu\edu\Network.java
文件 390 2013-01-19 12:25 SOM_OCR\src\wz\cs\szu\edu\sample.dat
文件 1550 2012-05-23 20:47 SOM_OCR\src\wz\cs\szu\edu\Sample.java
文件 2745 2012-05-24 15:16 SOM_OCR\src\wz\cs\szu\edu\SampleData.java
文件 5687 2012-05-23 20:55 SOM_OCR\src\wz\cs\szu\edu\TrainingSet.java
目录 0 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu\edu
目录 0 2012-07-02 21:55 SOM_OCR\src\wz\cs\szu\edu
目录 0 2013-01-19 12:11 SOM_OCR\bin\wz\cs\szu
目录 0 2012-07-02 21:55 SOM_OCR\src\wz\cs\szu
目录 0 2013-01-19 12:11 SOM_OCR\bin\wz\cs
目录 0 2012-07-02 21:55 SOM_OCR\src\wz\cs
目录 0 2013-01-19 12:11 SOM_OCR\bin\wz
............此处省略7个文件信息
- 上一篇:车牌识别卡片库包含字符字母数字
- 下一篇:httpmime-4.1.1.jar
相关资源
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论