资源简介
Java Tess4J 实现OCR 可运行Demo
代码片段和文件信息
/**
* JDeskew
*/
package com.recognition.software.jdeskew;
import java.awt.image.BufferedImage;
public class ImageDeskew {
/**
* Representation of a line in the image.
*/
public class HoughLine {
// count of points in the line
public int count = 0;
// index in matrix.
public int index = 0;
// the line is represented as all x y that solve y * cos(alpha) - x *
// sin(alpha) = d
public double alpha;
public double d;
}
// the source image
private BufferedImage cImage;
// the range of angles to search for lines
private double cAlphaStart = -20;
private double cAlphaStep = 0.2;
private int cSteps = 40 * 5;
// pre-calculation of sin and cos
private double[] cSinA;
private double[] cCosA;
// range of d
private double cDMin;
private double cDStep = 1.0;
private int cDCount;
// count of points that fit in a line
private int[] cHMatrix;
// constructor
public ImageDeskew(BufferedImage image) {
this.cImage = image;
}
// calculate the skew angle of the image cImage
public double getSkewAngle() {
ImageDeskew.HoughLine[] hl;
double sum = 0.0;
int count = 0;
// perform Hough Transformation
calc();
// top 20 of the detected lines in the image
hl = getTop(20);
if (hl.length >= 20) {
// average angle of the lines
for (int i = 0; i < 19; i++) {
sum += hl[i].alpha;
count++;
}
return (sum / count);
} else {
return 0.0d;
}
}
// calculate the count lines in the image with most points
private ImageDeskew.HoughLine[] getTop(int count) {
ImageDeskew.HoughLine[] hl = new ImageDeskew.HoughLine[count];
for (int i = 0; i < count; i++) {
hl[i] = new ImageDeskew.HoughLine();
}
ImageDeskew.HoughLine tmp;
for (int i = 0; i < (this.cHMatrix.length - 1); i++) {
if (this.cHMatrix[i] > hl[count - 1].count) {
hl[count - 1].count = this.cHMatrix[i];
hl[count - 1].index = i;
int j = count - 1;
while ((j > 0) && (hl[j].count > hl[j - 1].count)) {
tmp = hl[j];
hl[j] = hl[j - 1];
hl[j - 1] = tmp;
j--;
}
}
}
int alphaIndex;
int dIndex;
for (int i = 0; i < count; i++) {
dIndex = hl[i].index / cSteps; // integer division no
// remainder
alphaIndex = hl[i].index - dIndex * cSteps;
hl[i].alpha = getAlpha(alphaIndex);
hl[i].d = dIndex + cDMin;
}
re
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 659 2014-09-29 10:54 Java_OCR\.classpath
文件 384 2014-09-29 09:59 Java_OCR\.project
文件 598 2014-09-29 09:59 Java_OCR\.settings\org.eclipse.jdt.core.prefs
文件 676 2014-09-29 10:54 Java_OCR\bin\com\recognition\software\jdeskew\ImageDeskew$HoughLine.class
文件 3616 2014-09-29 10:54 Java_OCR\bin\com\recognition\software\jdeskew\ImageDeskew.class
文件 1432 2014-09-29 10:54 Java_OCR\bin\com\recognition\software\jdeskew\ImageUtil.class
文件 17021 2014-09-29 11:12 Java_OCR\bin\com\ricky\java\ocr\TessAPITest$TessDllAPIImpl.class
文件 17810 2014-09-29 11:12 Java_OCR\bin\com\ricky\java\ocr\TessAPITest.class
文件 4206 2014-09-29 11:12 Java_OCR\bin\com\ricky\java\ocr\Tesseract1Test$Tess1Extension.class
文件 1520 2014-09-29 11:12 Java_OCR\bin\com\ricky\java\ocr\Tesseract1Test$Word.class
文件 5657 2014-09-29 11:12 Java_OCR\bin\com\ricky\java\ocr\Tesseract1Test.class
文件 14789120 2014-09-29 11:11 Java_OCR\bin\gsdll64.dll
文件 2120704 2014-09-29 10:34 Java_OCR\bin\liblept168.dll
文件 2000384 2014-09-29 10:34 Java_OCR\bin\libtesseract302.dll
文件 1334 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\ITesseract.class
文件 552 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$ETEXT_DESC.class
文件 555 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$Tessba
文件 579 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessMutableIterator.class
文件 408 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessOcrEngineMode.class
文件 418 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessOrientation.class
文件 570 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessPageIterator.class
文件 418 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessPageIteratorLevel.class
文件 782 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessPageSegMode.class
文件 838 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessPolyBlockType.class
文件 576 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessResultIterator.class
文件 399 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessTextlineOrder.class
文件 414 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI$TessWritingDirection.class
文件 8241 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI.class
文件 556 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI1$ETEXT_DESC.class
文件 559 2014-09-29 10:54 Java_OCR\bin\net\sourceforge\tess4j\TessAPI1$Tessba
............此处省略86个文件信息
- 上一篇:android开发讯飞离线命令词识别demo
- 下一篇:移动应用商城app
相关资源
- 一款简单基于Tesseract的OCR Android APP
- tesseract-OCR GUI版本-Mac版本
- commons Daemon+Procrun将java程序安装为wi
- tess4j-demo
- tess4j-4.0.2.jar
- tess4j2.0相关资料
- ocr tess4j java demo识别图片技术
- Java OCR 图像智能字符识别-文字识别
- 百度OCR文字识别案例_android防止ak&sk
- Java OCR 图像智能字符识别技术,可识
- java 识别图片中英文
- Tess4J-src
- java百度OCR文字识别名片信息补充
- Java+OpenCV+OCR 图像字符处理
- AspriseOcr.dll 64破解版 无弹框
- tess4j中文字库(chi_sim.traineddata)
- JAVA OCR
- 百度OCR文字识别,Java版本案例
- baiduAPISDK
- 百度OCR文字识别 app源码
- android ocr 图像识别
- 最全的OCR图像识别技术源码内有说明
- android 拍照后,识别图片中的文字(
- android OCR图像识别
评论
共有 条评论