導航:首頁 > 文字圖片 > 圖片文字提取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相關的資料

熱點內容
手機拍婚紗照怎麼好看圖片 瀏覽:125
紋理發型大卷圖片 瀏覽:338
兒童工程車圖片大全 瀏覽:244
動漫男生聽歌圖片 瀏覽:511
vivo點亮屏幕怎麼有圖片啊 瀏覽:8
怎麼做帶字的頭像圖片 瀏覽:459
夏季菜譜大全帶圖片 瀏覽:893
朋友圈圖片轉發朋友圈怎麼轉發 瀏覽:609
酒壺草圖片及價格 瀏覽:538
如何讓圖片樹葉變綠 瀏覽:860
word裡面刪除圖片中的一部分 瀏覽:7
如何把圖片變ppd 瀏覽:593
如何圖片填充ppt 瀏覽:825
word里照片如何轉化為圖片 瀏覽:860
古代衣服繪畫圖片裙子 瀏覽:918
美國女生正裝圖片 瀏覽:868
男生西裝翹二郎腿的圖片 瀏覽:727
動漫粉女孩圖片 瀏覽:188
荷花發型圖片大全 瀏覽:695
女生單眼皮狐狸眼圖片 瀏覽:987