android - Threshold image using opencv (Java) -


i working opencv project. need convert image below threshold image

original image

i tried function:

imgproc.threshold(imggray, imgthreshold, 0, 255, imgproc.thresh_binary + imgproc.thresh_otsu);  

but result not good, see below

threshold

so tried adaptivethreshold function:

imgproc.adaptivethreshold(imggray, imgthreshold, 255, imgproc.adaptive_thresh_gaussian_c, imgproc.thresh_binary, 11, 2);  

and resulted:

adaptivethreshold

i expect binary image white background , black text only, no black area or noise ( not prefer using photo.fastnlmeansdenoising because takes lot of time). please me solution this.

also, using tesseract japanese recognization accuracy rate not good. have suggestion on better ocr japanese, or method improve tesseract quality?

adaptivethreshold right choice here. just need litte tuning. these parameters (it's c++, can translate java)

mat1b gray= imread("path_to_image", imread_grayscale); mat1b result; adaptivethreshold(gray, result, 255, adaptive_thresh_mean_c, thresh_binary, 15, 40); 

the resulting image is:

enter image description here


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -