I am trying to make algorithm to process image for better accuracy of tesseract OCR.
I am using the EmguCV for C#.
First i am applying a binarization of the image
the using the emguCV edge detection
then how to make hole filling using the emgucv
that is a bit unclear to me
Here are some results:
binarization
edge detection
What I have tried:
Here is the code that I am using for the egde detection.
For the binarization I iterate the pixels and make the pixels whiter and darker.
bmp = ImageLibrary.FilterImage(bmp, 95);
Image<gray, byte=""> input = new Image<gray, byte="">(bmp);
Image<gray, byte=""> output = input.ThresholdAdaptive(new Gray(255), Emgu.CV.CvEnum.AdaptiveThresholdType.MeanC, Emgu.CV.CvEnum.ThresholdType.Binary, 3, new Gray(0.03));
input.ThresholdAdaptive(new Gray(255), AdaptiveThresholdType.GaussianC, ThresholdType.Binary, 11, new Gray(2));