public class RecognitionImage extends Object
文件名:RecognitionIdentifyingCode.java
用途:用于对图片中的文本进行识别
编码时间:2018年11月29日 下午7:51:59
Constructor and Description |
---|
RecognitionImage() |
Modifier and Type | Method and Description |
---|---|
static String |
judgeImage(File imageFile)
用于识别图片中的英文、数字文本,使用方法前需要设置语言包的存储路径
|
static String |
judgeImage(File imageFile,
int x,
int y,
int width,
int height)
用于识别图片某一部分中的指定语言的文本,使用方法前需要设置语言包的存储路径
|
static String |
judgeImage(File imageFile,
String language)
用于识别图片中的指定语言的文本,使用方法前需要设置语言包的存储路径
|
static String |
judgeImage(File imageFile,
String language,
int x,
int y,
int width,
int height)
用于识别图片某一部分中的指定语言的文本,使用方法前需要设置语言包的存储路径
|
static void |
setTessdataPath(File tessdataFolder)
设置语言包文件夹的路径,注意,此处是只需要存储语言包存放的文件夹。不需要定位到某一个语言包上,但文件夹的最后一层必须以“tessdata”来命名
|
public static void setTessdataPath(File tessdataFolder)
tessdataFolder
- 语言包存放的文件夹路径public static String judgeImage(File imageFile)
imageFile
- 图片文件public static String judgeImage(File imageFile, String language)
imageFile
- 图片文件language
- 语言(其值为语言包文件名称后最前的名称)public static String judgeImage(File imageFile, String language, int x, int y, int width, int height)
imageFile
- 图片文件language
- 语言(其值为语言包文件名称后最前的名称)x
- 图片起始位置x值(相对图片左上角)y
- 图片起始位置y值(相对图片左上角)width
- 图片需要裁剪的宽度(相对x值)height
- 图片需要裁剪的高度(相对y值)Copyright © 2024. All rights reserved.