導航:首頁 > 文字圖片 > java識別圖片中文字體

java識別圖片中文字體

發布時間:2022-05-10 10:26:34

㈠ 用JAVA編寫一個程序識別圖片上的文字

這種想法太瘋狂了。。目前能實現辨別圖片里的數字是正常的,辨別英文也有點難度,中文就更難了。。辨別圖像裡面的文字數字,不是想像的那麼簡單的,要從像素著手的,比較特定區域的像素,然後程序做出判斷,程序實現起來還是比較復雜的

㈡ java有讀取圖片裡面文字的方法嗎

使用tesseract-ocr,可以識別簡單的驗證碼,中文沒嘗試過

㈢ java判斷圖片是否有中文

ImageIcon類裡面本身沒有提供圖片比較的方法
如果樓主是想比較ImageIcon的來源是不是一樣
最好是自己程序裡面記錄下來圖片的Url或者文件地址
根據自己保存的來源來判斷一不一樣

如果是想判斷兩張來源不同的圖片是不是相等
那就得用到圖像判斷了
可以從ImageIcon中把圖片去出來用getImage()獲得到Image對象
把Image對象轉成BufferedImage對象
然後比較每個像素點的顏色
有不一樣的就說明不是一張圖片了

㈣ Java如何判斷中文簡體繁體

[\u4e00-\u9fa5]
這個可以判斷是不是漢字,我測試時,不能區分簡繁。

找到下邊這些JS的正則。(測試也區分不了簡繁。)
[\u2E80-\u9FFF]+$ 匹配所有東亞區的語言
[\u4E00-\u9FFF]+$ 匹配簡體和繁體
[\u4E00-\u9FA5]+$ 匹配簡體

希望能你有點幫助,我再找找怎麼區分簡繁。

㈤ 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如何識別漢字字元

可以用正則表達式識別的, 用正則表達式"[\u4e00-\u9fa5]"匹配
字元串,可以找到是否有中文,如果只匹配一個字元,
就可以看到是不是中文

範例:
public static boolean isChinese(char c) {
String regEx = "[\u4e00-\u9fa5]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(c + "");
if (m.find())
return true;
return false;
}

㈦ Java調用OCR進行圖片識別,能同時識別中文簡體和中文繁體嗎

這和java無關,是ocr軟體的事,而且一般不能同時支持

㈧ 用JAVA編寫一個程序識別圖片上的文字;這個難題你實現了嗎

這種不是個人可以處理的,也不是java的強項,去找提供ocr api的廠商吧。

㈨ 用Java讀取一張圖片,並識別圖中的所有漢字,怎麼解決

這個要是自己去寫,估計很難,需要用到很多AI智能的演算法,可以調用谷歌或者網路的識圖API

閱讀全文

與java識別圖片中文字體相關的資料

熱點內容
龍簡單圖片 瀏覽:128
幼兒園主題牆簡單手工製作圖片 瀏覽:329
漫畫少女手繪圖片簡單同桌 瀏覽:287
簡單素描人頭圖片大全 瀏覽:665
圖片ps如何修魔鬼圖片 瀏覽:869
感謝一路有你文字圖片 瀏覽:294
word文檔圖片怎麼換成黑白色 瀏覽:98
胖子表情包圖片可愛 瀏覽:38
10塊錢真實人民幣高清圖片 瀏覽:26
手指甲圖片簡單 瀏覽:215
女生手拿雪碧圖片 瀏覽:62
圖片放在word裡面變成白色 瀏覽:29
漫畫圖片男生冷酷高傲 瀏覽:301
層次直發型圖片女背面 瀏覽:703
初一兩個男生背影圖片 瀏覽:176
美女操動態圖片百度網盤 瀏覽:513
什麼是梨花頭發型圖片 瀏覽:240
背書包的女孩圖片 瀏覽:46
小女孩看書簡筆畫圖片 瀏覽:875
女生到肩發型圖片 瀏覽:750