I try to make the image evenly bright using the morphological closure operation, as a prelude to the adaptive threshold. My method is to divide each pixel in the image by the value of that pixel after the close operation, and then normalize:
Imgproc.GaussianBlur(sudokuImage, sudokuImage, new Size(5,5), 0); Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(11,11)); Imgproc.morphologyEx(image, closedImage, Imgproc.MORPH_CLOSE, kernel); Core.divide(image, closedImage, image); Core.normalize(image, image, 0, 255, Core.NORM_MINMAX);
Here is the result:
- Top Left - Original Image
- Upper Right - After Gaussian Blur
- Bottom left is the result of the close operation
- Bottom right - the end result

I want the last image to be less blurry, more like the image below (which was obtained using the same method in this post ). How can i do this?

source share