bmorph - binary morphological transforms

版本 1.4.0.0 (152.5 KB) 作者: tudor dima
Fast binary erosion and dilation, with even faster iterative calls.
1.6K 次下载
更新时间 2012/4/30

查看许可证

This function performs binary erosion or dilation.

It is faster than imerode.m and imdilate.m -- by more than an order of magnitude for any structuring element other than 'square' or 'disk' .
The only time it is slightly slower (about 10%) is for very small 'square' or 'disk' strels only.
Moreover, ’disk’ structuring elements in Matlab are actually octagonal, and often times a
true ’circular’ element is necessity.

It also comes in very handy when you don't have the Matlab Image Processing Toolbox :-)...

The function also allows very fast iterative calls which re-use the work done at previous iterations. (for instance when sweeping the size/size+shape of the structuring element while looking for a certain effect, a threshold in image statistics, etc.)
This re-use will make the speed increase compound exponentially, and one can also break the execution when desired.

For 2-3M pix images and strels in the range of 10-20 pixels the speed increase can be around 20x - 100x (depending on the machine cache, slightly on strel shape, etc.), with higher values as the image and/or strel size increase.

Simple call:
------------------------------------------
IMG_OUT = BMORPH(IMG_IN, SE, DilateNotErode, [], ObjStopAtEdge)

IMG_DIL = BMORPH(IMG_IN, SE, true); % dilate
IMG_ERO = BMORPH(IMG_IN, SE, false); % erode
% erode assuming the objects stop at edge :
IMG_ERO = BMORPH(IMG_IN, SE, false, [], true);

For iterative calls and more info on execution speed see the help in bmorph.m and the attached .pdf file.

引用格式

tudor dima (2026). bmorph - binary morphological transforms (https://ww2.mathworks.cn/matlabcentral/fileexchange/26493-bmorph-binary-morphological-transforms), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2007b
兼容任何版本
平台兼容性
Windows macOS Linux
版本 已发布 发行说明
1.4.0.0

v.0.3b, 29.04.2012
- allow asymmetrical strels
- small speed improvements

1.0.0.0