资源简介

通过摄像头识别汉字,字符和数字

资源截图

代码片段和文件信息

package com.mikewong.tool.tesseract;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Color;

public class ImgPretreatment {

private static Bitmap img;
private static int imgWidth;
private static int imgHeight;
private static int[] imgPixels;

private static void setImgInfo(Bitmap image) {
img = image;
imgWidth = img.getWidth();
imgHeight = img.getHeight();
imgPixels = new int[imgWidth * imgHeight];
img.getPixels(imgPixels 0 imgWidth 0 0 imgWidth imgHeight);
}

/**
 * 将图片化成灰度图
 * 
 * @param img
 * @return
 */
public static Bitmap converyToGrayImg(Bitmap img) {

setImgInfo(img);

return getGrayImg();
}

/**
 * 对图像进行预处理
 * 
 * @param img
 * @return
 */
public stati

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\
     文件         466  2015-02-24 05:47  TesseractTest_SRC-master\.classpath
     文件         849  2015-02-24 05:47  TesseractTest_SRC-master\.project
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\.settings\
     文件         177  2015-02-24 05:47  TesseractTest_SRC-master\.settings\org.eclipse.jdt.core.prefs
     文件        1826  2015-02-24 05:47  TesseractTest_SRC-master\AndroidManifest.xml
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\assets\
     文件     3112137  2015-02-24 05:47  TesseractTest_SRC-master\assets\eng.traineddata
     文件       51394  2015-02-24 05:47  TesseractTest_SRC-master\ic_launcher-web.png
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\libs\
     文件      385685  2015-02-24 05:47  TesseractTest_SRC-master\libs\android-support-v4.jar
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi-v7a\
     文件      143916  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi-v7a\libjpeg.so
     文件     1065212  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi-v7a\liblept.so
     文件     1882276  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi-v7a\libtess.so
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi\
     文件      151304  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi\libjpeg.so
     文件     1109316  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi\liblept.so
     文件     1947800  2015-02-24 05:47  TesseractTest_SRC-master\libs\armeabi\libtess.so
     文件      138629  2015-02-24 05:47  TesseractTest_SRC-master\libs\tess-two.tesseract3.01-leptonica1.68-LibJPEG6b.jar
     文件          53  2015-02-24 05:47  TesseractTest_SRC-master\lint.xml
     文件         781  2015-02-24 05:47  TesseractTest_SRC-master\proguard-project.txt
     文件         563  2015-02-24 05:47  TesseractTest_SRC-master\project.properties
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\res\
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-hdpi\
     文件        6416  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-hdpi\ic_launcher.png
     文件         385  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-hdpi\landscape.PNG
     文件         333  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-hdpi\portrait.PNG
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-mdpi\
     文件        3981  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-mdpi\ic_launcher.png
     目录           0  2015-02-24 05:47  TesseractTest_SRC-master\res\drawable-xhdpi\
............此处省略34个文件信息

评论

共有 条评论