2012-11-19 28 views
4

我試圖使用形態學關閉操作使圖像均勻明亮,作爲自適應閾值的前奏。我的方法是通過關閉操作之後該像素的值,以在圖像中的每個像素劃分,然後歸一化:改善形態學關閉

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); 

下面是結果:

  • 左上 - 原始圖像
  • 右上 - 高斯模糊
  • 左下後 - 關閉操作
  • 右下的結果 - 最終的結果

enter image description here

我想在最終圖像要少褪色的,更像下面的圖像(其使用什麼樣子在this post相同的方法獲得)。我怎樣才能做到這一點?

enter image description here

回答

3

也許問題出在分割步驟,你似乎對整數,而帖子鏈接到彩車上進行演出。

+0

好的,謝謝! –