Re: Blanking all 5x5 windows with less than X 'on' pixels in them [message #74544 is a reply to message #74543] |
Thu, 20 January 2011 15:24   |
Gray
Messages: 253 Registered: February 2010
|
Senior Member |
|
|
On Jan 20, 3:03 pm, Ben Tupper <ben.bigh...@gmail.com> wrote:
> On 1/20/11 2:35 PM, Robin Wilson wrote:
>
>> Hi Ben
>
>>> Have you looked at MORPH_OPEN? I think it would be a good place to start.
>
>> I have investigated this, but I don't think it'll do what I want as it
>> will affect the other pixels in the image too. I'm hoping just to
>> operate on pixels that have a lot of space around them (for example,
>> maybe with a 9x9 window, and only having three pixels turned on). Can
>> MORPH_OPEN do this?
>
>> Robin
>
> Hmmm. So, it isn't just a matter of the size of the speck but also the
> amount of white space around it.
>
> Filtering by size isn't such a big issue - you could even use histogram
> operating on a labeled version of your image. You could also use
> Morph_HitOrMiss for this.
>
> The Morph_TopHat function might also be worth checking out. You can
> control the amount of "brim-width" to allow when you specify the
> structure.
You have the indices where the pixels are, do you not? Or did I miss
a step?
IDL> array[x-2:x+2,y-2:y+2] = 0
|
|
|