導航:首頁 > 文字圖片 > java識別圖片文字位置

java識別圖片文字位置

發布時間:2023-02-02 06:01:21

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

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

㈡ 用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有讀取圖片裡面文字的方法嗎

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

㈣ 求哪位老闆 賜教 java中 JLabel中放圖片和文字 如何讓文字顯示在圖片正下方居中位置

void
setHorizontalAlignment(int alignment)

設置標簽內容沿 X 軸的對齊方式。

void
setHorizontalTextPosition(int textPosition)

設置標簽的文本相對其圖像的水平位置。

這兩個方法。
label.setVerticalTextPosition(JLabel.BOTTOM);
label.setHorizontalTextPosition(JLabel.CENTER);

㈤ java 判斷圖形在圖片中的位置

java.awt.image.BufferedImage image=javax.imageio.ImageIO.read(java.IO.File imagefile);

int rgbs[]=new int[100*100];
rgbs=rimage.getRGB(0,0,100,100,rgbs,0,100);

int r=200;
int gb=50;
int index=0;
for(int i=0;i<100*100;i++){
Color color=new Color(rgbs[i]);
if(color.getRed()>r&&color.getGreen()<gb&&color.getBlue()<gb){
index=i;
break;
}
}

int y=i/100;
int x=i%100;

y是上方距離,x是左方距離。

㈥ 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怎麼截取圖片需要識別的文字區域

這個牽涉到很多圖像技術。比如圖片處理,包括銳化、除燥、二值化圖片等等操作,還有一堆演算法去計算圖像區域,與圖像邊界。

㈧ 怎麼用java實現圖片裡面的數字識別

圖片是由點組成(或者是別的方法),記錄點的位置、顏色,控制點就行了。至於ocr,有難度,首先要製作文字的變化范圍及整個字各部分的聯系,這還是簡單的。然後,圖像分解就行了。額,我不會編程,稍微會點c++,所以這個回答就是假設如果我做這種程序的思路。

㈨ java 如何讀取附加到圖片上的文字

圖片上的文字是沒法讀取的,以為這涉及到圖像處理。非常非常復雜!因為如果你非要讀取圖片上的文字,不是幾行代碼可以搞定的,首相從matlaB開始學,了解什麼是圖像處理。然後再開發相應的jar包。當然,你也可以使用相關的軟體工具,比如識圖軟體,通過讀取軟體的反饋也算是讀取了圖片上的文字

㈩ java截圖後怎麼用tesseract 文字識別

網上傳的代碼示例大多是在Windows下安裝Tesseract ORC後通過CMD命令操作進行圖識別操作.而 Tess4j 針對Tesseract 提供了JNI支持,同時還提供了一些圖片操作的工具類,提供比如圖片放大,旋轉,黑白處理,銳化 等用來提高識別率的操作.操作十分方便. T

閱讀全文

與java識別圖片文字位置相關的資料

熱點內容
第二套衣服圖片 瀏覽:319
運輸局制服衣服圖片 瀏覽:936
鏍絲燙發發型圖片 瀏覽:673
美女露100奶頭無擋的圖片 瀏覽:917
灰白色頭發圖片女生 瀏覽:731
微信鈔票圖片大全 瀏覽:383
中澳混血兒圖片女孩唯美 瀏覽:378
唯美手寫文字圖片 瀏覽:299
女孩露臀誘惑圖片 瀏覽:231
棕黑衣服圖片 瀏覽:204
男生圖片怎麼調色好看 瀏覽:749
衣服的logo圖片怎樣清除 瀏覽:338
拿話筒的女生頭像圖片動漫 瀏覽:531
火影忍者男生的內褲圖片 瀏覽:984
如何將ppt保存為長圖片 瀏覽:727
長莫西干發型圖片 瀏覽:883
古板衣服圖片 瀏覽:493
如何把一張圖片分成三個部分 瀏覽:345
出國旅遊美女風景圖片 瀏覽:54
動漫圖片大全帥氣女生 瀏覽:492