[Image-SIG] how to create mask NxN automatically

Christopher Barker Chris.Barker at noaa.gov
Thu Nov 18 19:37:14 CET 2010


On 11/18/10 8:47 AM, Chris Mitchell wrote:
> Are you using numpy or doing for loops?

definitely a job for numpy -- if you aren't using it, check it out.

-CHB


> On Thu, Nov 18, 2010 at 10:46 AM, Maxime demers<burton.1 at sympatico.ca>  wrote:
>> Hi everyone,
>>
>> I would like to hear you about the possibility to create mask of N dimension
>> to "scan" an image. The aim of this mask is to check for each pixel if its
>> value is between the intervals confidence of the mask's pixels or not. Im
>> looking for a function that will create a mask of the desired dimension of
>> the user. For instance: 3x3, 5x5, 7x7, 11x11, etc.
>>
>> if the scanned pixel is defined by (i,j)
>> the function should put all the values of the mask NxN at the position (i,j)
>> into a list.
>>
>> For now, I can manualy create mask of 3x3 and 5x5 by including the pixels
>> (i-1,j-1) to (i+1,j+1) etc... in a list, but its getting complicated for 7x7
>> and bigger mask.
>>
>> Thanks for your help, its really appreciated
>>
>> Maxime Demers
>> Geomatics and Remote Sensing
>> University de Sherbrooke
>>
>> _______________________________________________
>> Image-SIG maillist  -  Image-SIG at python.org
>> http://mail.python.org/mailman/listinfo/image-sig
>>
>>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Image-SIG mailing list