【发布时间】:2012-11-06 22:04:22
【问题描述】:
我正在尝试使用形态闭合操作使图像均匀明亮,作为自适应阈值的前奏。我的方法是关闭操作后,将图像中的每个像素除以该像素的值,然后进行归一化:
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);
结果如下:
- 左上角 - 原始图像
- 右上角 - 高斯模糊后
- 左下 - 关闭操作的结果
- 右下角 - 最终结果
我希望最终图像不那么褪色,更像下面的图像(它是使用this post 中的相同方法获得的)。我怎样才能做到这一点?
【问题讨论】: