Re: int of pixel and surrounding pixels [message #56029] |
Tue, 25 September 2007 10:36 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Whoops! Should be this:
mean = Smooth(image,3)
values = mean[x,y]
Instead of this:
mean = Mean(image, 3)
values = mean[x, y]
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: int of pixel and surrounding pixels [message #56030 is a reply to message #56029] |
Tue, 25 September 2007 10:34  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
rpertaub@gmail.com writes:
> I am trying to find the intensity of a pixel and its surrounding
> pixel.
>
> I have a list of x and y coordinates as my points of interest. I want
> to find the intensity at that pixel and the ones surrounding it and
> obtain a mean of those 9 pixels. I want to do this for all my
> coordinates, so I will be using a for loop to go from one coordinate
> to another. Is there a quick way of reading the pixel int of adjacent
> pixels so my for loop is not too slow?
You want something like this:
mean = Mean(image, 3)
values = mean[x, y]
Where X and Y are vectors of your coordinates.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: int of pixel and surrounding pixels [message #56031 is a reply to message #56030] |
Tue, 25 September 2007 10:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
rpertaub@gmail.com writes:
> I am trying to find the intensity of a pixel and its surrounding
> pixel.
>
> I have a list of x and y coordinates as my points of interest. I want
> to find the intensity at that pixel and the ones surrounding it and
> obtain a mean of those 9 pixels. I want to do this for all my
> coordinates, so I will be using a for loop to go from one coordinate
> to another. Is there a quick way of reading the pixel int of adjacent
> pixels so my for loop is not too slow?
You want something like this:
mean = Mean(image, 3)
values = mean[x, y]
Where X and Y are vectors of your coordinates.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|