android - Threshold image using opencv (Java) -
i working opencv project. need convert image below threshold image

i tried function:
imgproc.threshold(imggray, imgthreshold, 0, 255, imgproc.thresh_binary + imgproc.thresh_otsu); but result not good, see below

so tried adaptivethreshold function:
imgproc.adaptivethreshold(imggray, imgthreshold, 255, imgproc.adaptive_thresh_gaussian_c, imgproc.thresh_binary, 11, 2); and resulted:

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:

Comments
Post a Comment