Apr 7, 2011

morphological image processing

Matlab 遵循如下 convention:

For
dilation, the Image Processing Toolbox follows the convention that pixels "outside" the image domain are 0 (OFF) for binary images. For erosion, IPT follows the convention that pixels outside the image domain are 1 (ON). These conventions have a number of theoretical advantages. For example, textbooks often give the duality relationship between erosion and dilation. This relationship doesn't hold unless you follow the IPT convention. It doesn't work out completely if you assume 0-valued out-of-bounds pixels for both dilation and erosion.

参见讨论页

这样的问题是,erosion 的时候,会出现一些问题,比如下图,structure element 为 [1 1],左边为 origin
右图为结果,其最右边本来不应该为1

解决办法是将图像进行 
zero padding -> erosion -> extraction

0 comments: