Hello everyone, I would like to clean an image and filter it
these imags are made by Arabic calligraphy and then scacnned, and then I made them white and black,
I want to get rid of the extra lines, points, noise etc, complete the missing point, what is the best approach I have applied Opening and Closing like this code as a starting point:
var src = cv.matFromImageData(jimpSrc.bitmap); var dst = new cv.Mat(); var M = cv.Mat.ones(5, 5, cv.CV_8U); var anchor = new cv.Point(-1, -1); let newDst = new cv.Mat(); cv.morphologyEx(src, dst, cv.MORPH_OPEN, M, anchor, 1, cv.BORDER_CONSTANT, cv.morphologyDefaultBorderValue()); cv.morphologyEx(dst, newDst, cv.MORPH_CLOSE, M);
It did’t give me what the result I want, in some pictures it gave me like this
what is the best approach to clean the images without destroying its quality?