Re: Blanking all 5x5 windows with less than X 'on' pixels in them [message #74551 is a reply to message #74550] |
Thu, 20 January 2011 11:31  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On 1/20/11 2:19 PM, Robin Wilson wrote:
> Hi,
>
> I've got a binary image and I want to clean it up a bit by removing all
> pixels (or small groups of pixels) which are surrounded by a lot of space.
>
> I can easily write code using CONVOL to tell me how many pixels were
> 'on' in that window, but I can't see an easy (and fast) way of blanking
> (as in, setting all the pixels to zero) in any windows where the CONVOL
> function has given a value greater than X.
>
> I can think of a way to do it in a loop (looping over all of the points
> that CONVOL found which were greater than X and then constructing 5x5
> windows around them), but there must be a proper 'IDL Way'. Any ideas?
>
> Robin
Hi,
Have you looked at MORPH_OPEN? I think it would be a good place to start.
Cheers,
Ben
|
|
|