Re: Blanking all 5x5 windows with less than X 'on' pixels in them [message #74541 is a reply to message #74540] |
Fri, 21 January 2011 02:41   |
Axel Martínez
Messages: 22 Registered: June 2010
|
Junior Member |
|
|
On Jan 21, 10:02 am, Robin Wilson <ro...@rtwilson.com> wrote:
> Hi Chris,
>
> That's great. Yes, your description is correct - that's exactly what I
> want to do.
>
> Cheers,
>
> Robin
>
>> Hi Robin,
>> i have such a vectorised function. Please give more details. Do you
>> want to clean all pixels including the center pixel in a moving
>> window, if the center pixel is below a threshold?
>
>> Cheers
>
>> CR
Hi Robin,
You described the problem in two different ways:
(1) clean the pixel neighborhood if the center pixel is below a
threshold
(2) clean the pixel if the number of neighbors on is below a threshold
I understand that you actually mean case (2). You can try that (I did
not test the code):
kernel_size = 9
threshold = 3.0 / (kernel_size*kernel_size) ;3 pixels on out of a 9x9
neighborhood
Image[WHERE(SMOOTH(image, [kernel_size,kernel_size], /EDGE_TRUNCATE)
LT threshold)] = 0
|
|
|