Closed GoogleCodeExporter closed 9 years ago
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 eric.bou...@gmail.com
on 15 Jun 2011 at 1:02
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 eric.bou...@gmail.com
on 17 Jun 2011 at 8:36
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 xwinstu...@gmail.com
on 13 Jan 2012 at 3:36
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 xwinstu...@gmail.com
on 13 Jan 2012 at 4:01
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 manem.su...@gmail.com
on 20 Feb 2012 at 12:08
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 mayco.va...@gmail.com
on 21 Feb 2012 at 11:53
Thanks Eric. Merged your fix in.
Original comment by alanv@google.com
on 11 Sep 2012 at 8:24
Original issue reported on code.google.com by
eric.bou...@gmail.com
on 15 Jun 2011 at 12:46