Score
0
Watch 39 Star 49 Fork 11

tboox / hnrC

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
脱机手写数字识别系统,可以将手机拍摄的 多行多列的 手写数字 进行识别, 整个系统 实现了完整的 图像处理、特征提取、网络训练等 一系列算法, 每个阶段的各种算法 都有自己独有的算法优化,以提高识别率 spread retract

Clone or download
imageconvector.cpp 854 Bytes
Copy Edit Web IDE Raw Blame History
ruki authored 2013-07-02 14:09 . ...
#include "imageconvector.h"
ImageConvector::ImageConvector()
{
}
image_type ImageConvector::convect(QImage const& qimage)
{
image_type image(qimage.width(), qimage.height());
for (int px = 0; px < qimage.width(); ++px)
{
for (int py = 0; py < qimage.height(); ++py)
{
QRgb qrgb = qimage.pixel(px, py);
image.at(px, py).red(qRed(qrgb));
image.at(px, py).green(qGreen(qrgb));
image.at(px, py).blue(qBlue(qrgb));
}
}
return image;
}
QImage ImageConvector::convect(image_type const& image)
{
QImage qimage(image.width(), image.height(), QImage::Format_RGB32);
for (int px = 0; px < image.width(); ++px)
{
for (int py = 0; py < image.height(); ++py)
{
qimage.setPixel(px, py, qRgb(image.at(px, py).red(), image.at(px, py).green(), image.at(px, py).blue()));
}
}
return qimage;
}

Comment ( 0 )

Sign in for post a comment

C
1
https://gitee.com/tboox/hnr.git
git@gitee.com:tboox/hnr.git
tboox
hnr
hnr
master

Search