# letersnumbers-classifier
Letters and numbers classifier in real time for chess games using computer vision and neural networks.
## Overview
This project tries to create a way to play chess by showing letters and numbers cards (describe in de folder letters_numbers) in real time, which will return the registered move (for example 'b1d1'), so a chess engine could play and move that piece.
## Methodology
We first trained a neural network model (Feed Forward) using 100 images of each letter and number that were obtained recording a webcam video and storing each frame (in the video we move each card a bit to ensure the network will generalized better each one). The model should do a good work with any similar letter or number card.
### Preprocessing
Each image was binarized, eroded and dilated (classical computer vision techniques). After that, it was cropped to get a new image getting rid of the background, so we just have the letter or number, and resized the image to 30x30 pixels. Here is an example:
![Preprocessed 'A' letter](images/preprocessed.png)
### Feature Extraction
Now we will extract the main features of each letter and number in order to use it as an input. We will be using the 7-segment display concept, that basically divide the image in 7 parts as shown below for every possible card:
![7-segment display concept](images/collage.png)
And we take the amount of letter/number in that section, that will be use as input for our neural network.
![Example of probabilities for letter 'A'](images/segments.png)
### Training
We will use those inputs to train a Feed Forward network with an input layer with 7 neurons, a single hidden layer with 10 neurons and a output layer with 8 neurons (since we will be using one network to classify letters and another for numbers).
The split will be: 80% (80 images of each letter/number) for training and 20% (20 images of each letter/number) for testing so we can know how good our network is, but after that we will use every image to train the model to get as much examples as possible.
### Results and conclusion
The predictions were fast enough to use then in real time, and good enough to classify each card in good conditions, but also with a bit of rotation added.
![Real demostration of letter prediction](images/frame.png)
![Prediction](images/prediction.png)
# MATLAB dependencies
- Deep Learning Toolbox
- Image Processing Toolbox
- Statistics and Machine Learning Toolbox
- Computer Vision Toolbox
没有合适的资源?快使用搜索试试~ 我知道了~
使用计算机视觉和神经网络的国际象棋游戏字母和数字分类器matlab代码.zip
共29个文件
png:22个
m:4个
mat:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 129 浏览量
2024-06-07
21:53:17
上传
评论
收藏 808KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
使用计算机视觉和神经网络的国际象棋游戏字母和数字分类器matlab代码.zip (29个子文件)
使用计算机视觉和神经网络的国际象棋游戏字母和数字分类器matlab代码
lettersNet.mat 2KB
numberClassifier.m 243B
extractPatterns.m 724B
letterClassifier.m 243B
va.m 5KB
numbersNet.mat 2KB
images
segments.png 60KB
prediction.png 76KB
feedback.png 83KB
frame.png 280KB
collage.png 53KB
preprocessed.png 1KB
README.md 2KB
letters_numbers
E.png 13KB
C.png 31KB
3.png 33KB
F.png 13KB
D.png 26KB
H.png 13KB
1.png 19KB
B.png 27KB
6.png 36KB
5.png 27KB
4.png 22KB
8.png 40KB
A.png 32KB
7.png 25KB
2.png 30KB
G.png 30KB
共 29 条
- 1
资源评论
matlab科研助手
- 粉丝: 3w+
- 资源: 5962
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- STM32参考资料STM32 固件库使用参考资料
- java智能停车后台管理系统源码数据库 MySQL源码类型 WebForm
- STM32参考资料STM32中断优先级与相关使用概念
- Linux环境下,关于C++静态库的封装和调用代码
- STM32参考资料STM32F10x常见应用解析
- java面试视频资源微服务架构之Spring Cloud Eureka 场景分析与实战
- java面试视频资源探索JVM底层奥秘ClassLoader源码分析与案例讲解
- java面试视频资源锁分布式锁无锁实战全局性ID
- java基于SSM的酒店管理系统源码数据库 MySQL源码类型 WebForm
- java面试视频资源JAVA并发编程之多线程并发同步业务场景与解决方案
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功