I want to maintain lines, so erode or close is out of the question. Planning on using region props and check each area region, but that seems slow and inefficient...
Tks
the problem is that this is to be used in a loop, so i want efficiency.
but at least that function will clear up the code. tks
Is that what u need?
help bwareaopen
BWAREAOPEN Morphologically open binary image (remove small objects).
Hope that it helps.
Son
Hi,
help bwmorph
the option 'clean' is interesting if you want to remove single dots
if you want to remove larger i.e. 2 pixels and smaller objects you could convolute with a box mask i.e. ones(3) and delete everything below 2 in the result.
hth
kinor
Other possibility, aside the suggestion made by ImageAnalyst, is to use a small median filter. You can "efficiently" apply it multiple times in a loop.
Igor
"Ironic Prata" <lixodo...@hotmail.com> wrote in message <hg98tv$2m$1...@fred.mathworks.com>...
In the image processing toolbox there is a use function called bwareaopen to do exactly this.
Hope this helps
Matt W
Like this:
stats = regionprops(binary, 'Area', 'PixelIdxList');
cleaned = binary;
for region = 1 : length(stats)
if stats(region).Area < MIN_AREA
cleaned(stats(region).PixelIdxList) = 0;
end
end
I can guarantee this is REALLY fast! ;)
HOW CAN WE DO THIS?
a hint:
- use REGIONPROPS to identify your small objects...
- then, remove them...
us