「java图片识别技术」java图像处理技术

博主:adminadmin 2022-12-18 03:42:08 72

本篇文章给大家谈谈java图片识别技术,以及java图像处理技术对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

java 怎么实现图像识别技术

开源的ocr一般准确性都欠佳,java有个开源的tesseract-ocr,可以看下

Java 可不可以做图像识别的系统

当然可以。

一、纯JAVA开发的技术可行性,即JAVA是否能够实现图像识别的各种算法。

二、如果第一点没有问题,纯JAVA与C++相比,开发效率上的差异。效率要低很多,和具体问题有关。

三、如果第一点没有问题且第二点差异不太大时,纯JAVA与C++相比,相同算法的情况下,软件运行效率的差异。运行效率的差异也很大,也是和具体的算法有关。

java 实现图片的文字识别

摘要图像识别是目前很热门的研究领域,涉及的知识很广,包括信息论、模式识别、模糊数学、图像编码、内容分类等等。本文仅对使用Java实现了一个简单的图像文本二值处理,关于识别并未实现。

步骤

建立文本字符模板二值矩阵

对测试字符进行二值矩阵化处理

代码

/*

* @(#)StdModelRepository.java

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation; either version 3 of the License, or

* (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU Library General Public License for more details.

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

package cn.edu.ynu.sei.recognition.util;import java.awt.Image;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import java.util.ArrayList;import java.util.List;import java.util.logging.Level;import java.util.logging.Logger;import javax.imageio.ImageIO;/** * Hold character charImgs as standard model repository.

* @author 88250

* @version 1.0.0.0, Mar 20, 2008

*/

public class StdModelRepository {

/** * hold character images

*/ List charImgs = new ArrayList();

/** * default width of a character

*/ static int width = 16 /** * default height of a character

*/ static int height = 28 /** * standard character model matrix

*/ public int[][][] stdCharMatrix = new int[27][width][height];

/** * Default constructor.

*/ public StdModelRepository() {

BufferedImage lowercase = null try {

lowercase = ImageIO.read(new File("lowercase.png"));

} catch (IOException ex) {

Logger.getLogger(StdModelRepository.class.getName()).

log(Level.SEVERE, null, ex);

}

for (int i = 0 i 26 i++) {

charImgs.add(lowercase.getSubimage(i * width,

0,

width,

height));

}

for (int i = 0 i charImgs.size(); i++) {

Image image = charImgs.get(i);

int[] pixels = ImageUtils.getPixels(image,

image.getWidth(null),

image.getHeight(null));

stdCharMatrix[i] = ImageUtils.getSymbolMatrix(pixels, 0).clone();

ImageUtils.displayMatrix(stdCharMatrix[i]);

}

}

}

/*

* @(#)ImageUtils.java

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation; either version 3 of the License, or

* (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU Library General Public License for more details.

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

package cn.edu.ynu.sei.recognition.util;import java.awt.Image;import java.awt.image.PixelGrabber;import java.util.logging.Level;import java.util.logging.Logger;/** * Mainipulation of image data.

* @author 88250

* @version 1.0.0.3, Mar 20, 2008

*/

public class ImageUtils {

/** * Return all of the pixel values of sepecified codeimage .* @param image the sepecified image

* @param width width of the image

* @param height height of the image

* @return */ public static int[] getPixels(Image image, int width, int height) {

int[] pixels = new int[width * height];

try {

new PixelGrabber(image, 0, 0, width, height, pixels, 0, width).grabPixels();

} catch (InterruptedException ex) {

Logger.getLogger(ImageUtils.class.getName()).

log(Level.SEVERE, null, ex);

}

return pixels;

}

资源来自:

Java 图像识别 数字图像处理 从一张JPG图片中识别出若干黑色小方块

你需要关注的主要是这个类:java.awt.image.BufferedImage

可以查阅相关的API。

java图像处理技术在《java核心技术8 下卷》中有比较详细的介绍。

相关技术要求和注意事项:RGB标准、ICC配置特性、

建议如果进行像素识别的话可以选取关键点的识别方式、而且确认像素是否符合要求使用RGB的范围识别而非精确识别。

至于具体的识别操作过程,需要你详细定义开始识别的位置标准(规定的或者识别图像获取)、边界标准、大小(识别块得SIZE)、分组(给识别块确定属性)等

想从一张Jpg图像中识别出若干黑色区域,用于对答题卡的涂卡部分进行自动算分。求Java图像分割与识别技术

其实不用想得太难。

处理图像像素用BufferImage类。

首先,你得确定指定的答题卡涂卡的每个可涂选点的物理像素位置,这一步可以用一张空白的答题卡进行人工采集数据,做成一个数据库形式就可以了。定义好这些可涂选点定义对应的选项A\B\C\D。

然后你从扫描仪得到图像,把图像载入,进行像素分析,假设扫描答题卡放置的方向是正确的,因此不用考虑识别答题卡放置方向。再来,好样的,从之前采集的数据库得到一个可涂选的像素坐标位置,用此去识别答题卡上对应的涂选框是否涂选,以此类推逐行识别,因为你之前已经在数据库里面定义好了对应的涂选点的含义了,在这里只要往数据库一查就知道(考生涂选的是什么)了!

下一步只要将试卷上考生涂选的选项转换为数据保存到考生考试数据库。

至于如何识别考生涂选的方块,一般答题卡的涂选选框就是一个固定的大小,你只要知道它高多少像素,宽多少像素。考生涂选选项笔迹时一般都和这个选框大小的区域差不多,只要统计这个位置之内的比较黑的颜色数量占此涂选框的面积%50以上,可以认为这个是考试涂选的

选项。

还有个建议:一般答题卡上面都有一些用来给答题卡识别软件使用的定位点,你抓住这些规则就应该能更准确定位到答题卡涂选选项的位置。

怎么用java实现图片里面的数字识别

图片是由点组成(或者是别的方法),记录点的位置、颜色,控制点就行了。至于ocr,有难度,首先要制作文字的变化范围及整个字各部分的联系,这还是简单的。然后,图像分解就行了。额,我不会编程,稍微会点c++,所以这个回答就是假设如果我做这种程序的思路。

java图片识别技术的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java图像处理技术、java图片识别技术的信息别忘了在本站进行查找喔。

The End

发布于:2022-12-18,除非注明,否则均为首码项目网原创文章,转载请注明出处。