comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: int of pixel and surrounding pixels
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: int of pixel and surrounding pixels [message #56029] Tue, 25 September 2007 10:36
David Fanning is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: int of pixel and surrounding pixels
Next Topic: Re: Faster way to convert a string array of dates to julian dates

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 00:12:06 PDT 2025

Total time taken to generate the page: 0.16275 seconds