1 | initial version |
I found a possible solution. First, I use only the red channel of the image, since print and handwriting do have less red:
Now we're back add a Thresholding problem, where I found ADAPTIVE_THRESH_MEAN_C works great:
adaptiveThreshold(srcMat, dst, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 21, 32)
Where a bigger blockSize value makes the characters bolder and a bigger c value reduces noise.