导航:首页 > 文字图片 > 图片文字提取java

图片文字提取java

发布时间:2022-10-09 10:45:25

❶ java怎么截取图片需要识别的文字区域

这个牵涉到很多图像技术。比如图片处理,包括锐化、除燥、二值化图片等等操作,还有一堆算法去计算图像区域,与图像边界。

❷ 用JAVA编写一个程序识别图片上的文字

这种想法太疯狂了。。目前能实现辨别图片里的数字是正常的,辨别英文也有点难度,中文就更难了。。辨别图像里面的文字数字,不是想象的那么简单的,要从像素着手的,比较特定区域的像素,然后程序做出判断,程序实现起来还是比较复杂的

❸ java 如何读取附加到图片上的文字

图片上的文字是没法读取的,以为这涉及到图像处理。非常非常复杂!因为如果你非要读取图片上的文字,不是几行代码可以搞定的,首相从matlaB开始学,了解什么是图像处理。然后再开发相应的jar包。当然,你也可以使用相关的软件工具,比如识图软件,通过读取软件的反馈也算是读取了图片上的文字

❹ 使用java如何实现从图片中读取图片中的文本信息呀

http://blog.csdn.net/problc/article/details/5800093 网上找的,希望是你想要的

❺ 用java怎么获得一张图片上的一个文字的坐标点 求高手解答

//提示:坐标依次打印在命令符窗口
//提示:坐标依次打印在命令符窗口
//提示:坐标依次打印在命令符窗口
//不就是监听鼠标事件吗?
importjavax.swing.*;
importjava.awt.*;
importjava.awt.event.*;
importjavax.swing.border.Border;

/**
*我想建立个界面,可以加载本机中图片。
*加载后可以通过鼠标点击获得图片上任意点坐标。
*提问者:sunny929929-试用期一级
*/
{
privateJLabeltipLabel;

/**
*main()
*/
publicstaticvoidmain(String[]args){
MyPictureframe=newMyPicture();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}

/**
*constructor
*/
publicMyPicture(){
setSize(800,600);//根据要求调整大小
setLocation(100,100);
setTitle("获得图片上任意点坐标");
setResizable(false);

Containercon=getContentPane();

ImageIconbgIcon=newImageIcon("bgpic.jpg");//注意图片的路径
ImagePanelbackpicPanel=newImagePanel(bgIcon);
backpicPanel.addMouseListener(this);
con.add(backpicPanel,BorderLayout.CENTER);

tipLabel=newJLabel("--------------------提示:坐标依次打印在屏幕上!--------------------");
con.add(tipLabel,BorderLayout.SOUTH);
}

/**
*
*/
publicvoidmousePressed(MouseEvente){
intx=e.getX();
inty=e.getY();
Stringmessage="("+x+","+y+")";
tipLabel.setText(message);
System.out.println(message);

}

publicvoidmouseReleased(MouseEvente){

}

publicvoidmouseEntered(MouseEvente){

}

publicvoidmouseExited(MouseEvente){

}

publicvoidmouseClicked(MouseEvente){

}

}

/**
*类ImagePanel,用于添加背景图片
*/
classImagePanelextendsJPanel{
privateImageimg;
publicImagePanel(ImageIconimageIcon){
img=imageIcon.getImage();
}

publicvoidpaintComponent(Graphicsg){
super.paintComponent(g);
g.drawImage(img,0,0,this);
}

}

❻ 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 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.e.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 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.e.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 <code>image< .>* @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;
}
资源来自:
http://blog.csdn.net/chief1985/article/details/2229572

❼ java 如何读取附加到图片上的文字

图片上的文字是没法读取的,以为这涉及到图像处理。非常非常复杂!因为如果你非要读取图片上的文字,不是几行代码可以搞定的,首相从matlaB开始学,了解什么是图像处理。然后再开发相应的jar包。当然,你也可以使用相关的软件工具,比如识图软件,通过读取软件的反馈也算是读取了图片上的文字

❽ java有读取图片里面文字的方法吗

使用tesseract-ocr,可以识别简单的验证码,中文没尝试过

❾ java中文字图片读取保存问题

JTextPane类的对象可以显示文本、图片和超链接等,在创建了一个JTextPane类的纯文本格式对象后,可以向里面填写入文字(英文或汉字等)、插入超链接或图片,但无法通过getText()方法获得其中除文字以外的内容,也即无法保存包含文字、图片和超链接的完全对象内容,而如果一开始创建的是JTextPane类的HTML格式对象,则虽然可以保存文字的样式(颜色和字体、字号等)但无法再通过insertIcon()方法插入、显示图片,更不能直接保存了,考虑到的解决思路:①通过手工在HTML文件中插入<img src="02.gif">语句来实现对图片的保存,可是这样比较不容易实现,需要将图片保存在特定位置,才可以在下次打开JTextPane类对象是显示出图片;②创建JTextPane类的纯文本对象,在插入图片、超链接、设置字体样式或其它任何对JTextPane类的对象进行的格式设置时均记录下设置的位置和内容,并和文本内容一起保存到硬盘文件中,下次读取时,按照记录重新恢复原内容,实现的过程更复杂;③将JTextPane对象通过对象序列化的方式在硬盘中保存为一个文件,下次读取时再反序列化为完整对象。
最后,选择了最好实现的第三种方法,序列化了JTextPane对象,表现出来的效果不错。不过,在实现过程中未考虑程序的运行效率,现在也不太清楚,这样的处理方式是不是比较没有效率哩?

阅读全文

与图片文字提取java相关的资料

热点内容
仓鼠图片大全 浏览:63
女孩各个阶段的发育期图片 浏览:294
女人的腰部图片大全 浏览:298
设计翻领短袖衣服草稿图片 浏览:907
被代替的文字图片 浏览:248
图片批量复制到word图片颠倒 浏览:45
图片头像女生气质背影短发 浏览:569
图片拖拽怎么做 浏览:350
拉丁衣服女孩图片大全 浏览:134
男生头像鸭舌帽子图片 浏览:728
16岁男生图片没有水印不遮脸 浏览:450
可爱卡通手机壁纸图片 浏览:243
女孩心灵受伤了图片 浏览:24
母鸡怎么画简笔画图片 浏览:648
日本田园犬图片大全 浏览:986
素描图片简单风景 浏览:354
触屏如何复制多张图片 浏览:67
招代理三个字可爱图片 浏览:785
汽车锁怎么锁图片 浏览:352
黑色纱衣服抽丝的图片 浏览:82