Ask Your Question
1

binarization of an image android

asked 2019-02-03 22:42:18 -0600

ojesus gravatar image

updated 2020-09-28 06:50:07 -0600

hello guys

i am developing an android application which is use for OCR from invoice so i am use tesseract library for ocr but some time some invoice images are not read by the tesseract library because some images are blurry and character are not readable so i want to binarize an image because tesseract work perfect on binarize image.

if any one have an idea please guide me.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-04 02:54:48 -0600

berak gravatar image

you already get a grayscale image in onCameraFrame(): then you can use functions like compare(), or threshold

public Mat onCameraFrame(Mat inputFrame) {
    Mat gray = inputFrame.gray();
    Mat bin = new Mat();
    Imgproc.threshold(gray, bin, 120, 255, Imgproc.THRESH_BINARY);

    // process bin image with tesseract

    bin.release(); // must be released manually !
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-02-03 22:42:18 -0600

Seen: 553 times

Last updated: Sep 30 '19