Hi Hussein,
Thanks for your informative reply.
What I am OCRing are identity cards which are scanned at 200dpi.
What I want to receive with OCR is only the identity number which is
at a specific loacation on the scanned image.
But the problem is that I couldn't find the right thresholding for a
batch of identity cards. They all seem to come out different after the
threshold process.
What I need is an adaptive algorithm. I couldn't find anything on the
net.
What exactly does tile and stripe thresholding do?
Does anybody have a good adaptive thresholding algorithm for Java?
Thank You..
On 16 Nisan, 18:58, Hussein <
al_om...@hotmail.com> wrote:
> The median is not a good adaptive global threshold. You need to find the valley between the potential two humps of the histrogram that represent the foreground and background assuming the background is kind of uniform and not a watershed. In watershed areas, you need tile or stripe thresholding where the page is divided into tiles or stripes. Or use regional segmentation.
>
> Now, finding the humps is work and I do not know if Java library has it. I do mine in C++ and every person writes his/her own binarization.
>
> There is no good thresholding technique for all applications; you can tune your routine from application to another and from one kind of imaging to another. The more robust the thresholding technique, the better your algorithm is.
>
> Hussein Al-Hussein
>
>
>
> > Date: Wed, 16 Apr 2008 00:45:56 -0700> Subject: Image optimization before tesseract> From:
tariktutu...@gmail.com> To:
tesser...@googlegroups.com> > > Hi,> > Can anybody recommend an optimization technique of a tiff file before> we pass it onto tess.> > I am writing my code in JAVA. I'm currently using Java Advanced> Imaging (JAI) Library. I have done thresholding and sharpening for an> image.> > But what I really want is to do a dynamic threshold operation meaning> different thresholding for each image.> > What I am using right now is:> > // Generate a histogram.> Histogram histogram => (Histogram)JAI.create("histogram",> pi).getProperty("histogram");> > // Get a threshold equal to the median.> double[] threshold = histogram.getPTileThreshold(0.2);> > // Binarize the image.> PlanarImage dst = JAI.create("binarize", pi, new> Double(threshold[0]));> PI = dst;> > As you can see this does a threshold of 0.2.> When I do this some text in images get really dark and some really> light.> > Is there a way of doing an adaptive threshold using JAI or any other> method?> > Thanks!> >- Alıntıyı gizle -
>
> - Alıntıyı göster -