Git Product home page Git Product logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
What version of the product are you using? On what operating system?

tessreact-for-android-1.00 (Lastest version from the svn as of 2011-06-14)
used ubuntu32 11.04 in a VirtualBox to build so files
source versions as in readme file
java application compiled using eclipse on Windows 7 64

What steps will reproduce the problem?
See previous Post

What is the expected output? What do you see instead?
I expect a B&W image with the text (foreground) in black and the background in 
white.
I get text in white with a black background, with kind of blocky pixels that is 
non-usable and barely readable.

Original comment by [email protected] on 15 Jun 2011 at 1:02

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I managed to fix the problem. It was when converting the 1bpp PIX to the 32 bit 
Android Bitmap.

The problem lies at line 194 of Writefile.cpp.

This line : 
dstx[0] = dstx[1] = dstx[2] = (srcx[0] & (dw % 8)) ? 0xFF : 0x00;
needs to be replaced by: 
dstx[0] = dstx[1] = dstx[2] = (1 << (7 - (dw & 7)) & srcx[0]) ? 0x00 : 0xFF;

The basic problem was that the bitwise AND was comparing srcx[0], an 8 bit 
integer (0-255), with the result of the modulo which is only 3 bits (0-7). 
Needs to compare with decreasing powers of 2 (like 2^(7-0)), so 128, 64, 32 
etc...

Also I inverted the results, to get a black foreground with a white background 
(? 0x00 : 0xFF).

Original comment by [email protected] on 17 Jun 2011 at 8:36

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
convertTo8 has similiar problem, do you know how to fix it? The following codes 
can not get acceptable result.

Pix p = Convert.convertTo8(ReadFile.readBitmap(bitmap));
baseApi.setImage(p); 

Original comment by [email protected] on 13 Jan 2012 at 3:36

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
bitmap is from Camera preview frame data processed by:

  public Bitmap renderCroppedGreyscaleBitmap() {
    int width = getWidth();
    int height = getHeight();
    int[] pixels = new int[width * height];
    byte[] yuv = yuvData;
    int inputOffset = top * dataWidth + left;

    for (int y = 0; y < height; y++) {
      int outputOffset = y * width;
      for (int x = 0; x < width; x++) {
        int grey = yuv[inputOffset + x] & 0xff;
        pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101);
      }
      inputOffset += dataWidth;
    }

    Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
    return bitmap;
  }

If I use a bitmap from file, convertTo8 and setImage work fine.

Original comment by [email protected] on 13 Jan 2012 at 4:01

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I am searching OCR for Credit Cards and bank Cheques.I found OCR tool for 
Cheques i.e, Clear Check 21 MICR but for the Credit cards  I didn't get any OCR 
tool.Is there any OCR library to support to develop Application for reading 
cheques and cards.If anyone know about this please give me some 
suggestions.............  

Original comment by [email protected] on 20 Feb 2012 at 12:08

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
hi eric

i have developed OCR application using android tesseract tools. there is a 
binarization using otsu and now im trying to change the binarization method 
using sauvola.

where should i make change?

here is the source of android tesseract that i am using as libarary for the 
application
https://github.com/rmtheis/tess-two

best regards

Original comment by [email protected] on 21 Feb 2012 at 11:53

from tesseract-android-tools.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Thanks Eric. Merged your fix in.

Original comment by [email protected] on 11 Sep 2012 at 8:24

  • Changed state: Fixed

from tesseract-android-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.