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

Home » Public Forums » archive » Re: pixel value to x and y position
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: pixel value to x and y position [message #67487] Thu, 30 July 2009 18:13 Go to next message
marknolan2006 is currently offline  marknolan2006
Messages: 5
Registered: February 2009
Junior Member
On Jul 30, 11:53 pm, Gianguido <gianguido.cia...@gmail.com> wrote:
> On Jul 30, 4:27 am, mark nolan <marknolan2...@gmail.com> wrote:
>
>> hi everyone!
>
>> can anyone check if this is correct way to convert pixel value to x
>> and y position (iam trying
>> to write a simple tracking code in IDL):
>
>> y = pixel_value/width_picture
>> x = pixel_value mod width_picture
>
>> i really have time on the x,it gives a wrong result. i think i got the
>> y coordinate correctly.
>
>> thanks and GOD bless!
>
>> mark
>
> is array_indices what you are looking for? how about using these free
> particle tracking procedures:http://www.physics.emory.edu/~weeks/idl/
>
> G


hey, ill try that, actually i dnt know that function, this would be my
first
time (iam new at idl).

thanks alot G and David!

GOD bless!
mark
Re: pixel value to x and y position [message #67502 is a reply to message #67487] Thu, 30 July 2009 08:53 Go to previous messageGo to next message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
On Jul 30, 4:27 am, mark nolan <marknolan2...@gmail.com> wrote:
> hi everyone!
>
> can anyone check if this is correct way to convert pixel value to x
> and y position (iam trying
> to write a simple tracking code in IDL):
>
> y = pixel_value/width_picture
> x = pixel_value mod width_picture
>
> i really have time on the x,it gives a wrong result. i think i got the
> y coordinate correctly.
>
> thanks and GOD bless!
>
> mark

is array_indices what you are looking for? how about using these free
particle tracking procedures: http://www.physics.emory.edu/~weeks/idl/

G
Re: pixel value to x and y position [message #67503 is a reply to message #67502] Thu, 30 July 2009 08:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mark nolan writes:

> i have a multi tiff file, pictures of a moving bead. we would
> like to track the movement of the bead. we first subtract
> background, then clean it up by setting up threshold and then
> i used the morph_open. finally we label the regions and
> descriminate our bead from others (by area matching). we then
> call the pixels that are in those regions. using the formula
> above we calculate the x and y for each pixel and then average
> it (i.e. total(x)/num_of_pixels). the y seems to be ok however
> we have weird results for the x. please help me!!

I don't know what "call the pixels" means, but if
you mean "identify the indices of the pixels in the
region of interest" with something like the WHERE function,
then I don't see any reason why you would have to know
the columns and rows. But, if you did, you could use
ARRAY_INDICES to obtain them.

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: pixel value to x and y position [message #67507 is a reply to message #67503] Thu, 30 July 2009 07:21 Go to previous messageGo to next message
marknolan2006 is currently offline  marknolan2006
Messages: 5
Registered: February 2009
Junior Member
On Jul 30, 9:25 pm, David Fanning <n...@dfanning.com> wrote:
> mark nolan writes:
>> can anyone check if this is correct way to convert pixel value to x
>> and y position (iam trying
>> to write a simple tracking code in IDL):
>
>> y = pixel_value/width_picture
>> x = pixel_value mod width_picture
>
>> i really have time on the x,it gives a wrong result. i think i got the
>> y coordinate correctly.
>
> I don't think this question can be answered from the way
> you have asked it. (At least I would have to make WAY
> too many assumptions to feel comfortable answering it.)
> What, exactly, are you trying to do?
>
> 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.")

i have a multi tiff file, pictures of a moving bead. we would
like to track the movement of the bead. we first subtract
background, then clean it up by setting up threshold and then
i used the morph_open. finally we label the regions and
descriminate our bead from others (by area matching). we then
call the pixels that are in those regions. using the formula
above we calculate the x and y for each pixel and then average
it (i.e. total(x)/num_of_pixels). the y seems to be ok however
we have weird results for the x. please help me!!

thanks and GOD bless!
mark
Re: pixel value to x and y position [message #67509 is a reply to message #67507] Thu, 30 July 2009 06:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mark nolan writes:

> can anyone check if this is correct way to convert pixel value to x
> and y position (iam trying
> to write a simple tracking code in IDL):
>
> y = pixel_value/width_picture
> x = pixel_value mod width_picture
>
> i really have time on the x,it gives a wrong result. i think i got the
> y coordinate correctly.

I don't think this question can be answered from the way
you have asked it. (At least I would have to make WAY
too many assumptions to feel comfortable answering it.)
What, exactly, are you trying to do?

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: pixel value to x and y position [message #67510 is a reply to message #67509] Thu, 30 July 2009 05:18 Go to previous messageGo to next message
MichaelT is currently offline  MichaelT
Messages: 52
Registered: May 2006
Member
Hi,

I guess it depends on how you generate pixel_value. If you start
counting at the bottom left corner and proceed right, your solution is
correct. If the counting is done differently, you need to modify your
equation(s).

Have you checked out the cursor procedure? Maybe this is something for
you?

Michael
Re: pixel value to x and y position [message #67567 is a reply to message #67487] Fri, 31 July 2009 00:45 Go to previous message
marknolan2006 is currently offline  marknolan2006
Messages: 5
Registered: February 2009
Junior Member
On Jul 31, 9:13 am, mark nolan <marknolan2...@gmail.com> wrote:
> On Jul 30, 11:53 pm, Gianguido <gianguido.cia...@gmail.com> wrote:
>
>
>
>
>
>> On Jul 30, 4:27 am, mark nolan <marknolan2...@gmail.com> wrote:
>
>>> hi everyone!
>
>>> can anyone check if this is correct way to convert pixel value to x
>>> and y position (iam trying
>>> to write a simple tracking code in IDL):
>
>>> y = pixel_value/width_picture
>>> x = pixel_value mod width_picture
>
>>> i really have time on the x,it gives a wrong result. i think i got the
>>> y coordinate correctly.
>
>>> thanks and GOD bless!
>
>>> mark
>
>> is array_indices what you are looking for? how about using these free
>> particle tracking procedures:http://www.physics.emory.edu/~weeks/idl/
>
>> G
>
> hey, ill try that, actually i dnt know that function, this would be my
> first
> time (iam new at idl).
>
> thanks alot G and David!
>
> GOD bless!
> mark- Hide quoted text -
>
> - Show quoted text -

i dnt know how you do it guys but your just briliant! the
array_indices work!! whooh!! thanks alot!

GOD bless and continue to be a blessing!

Cheers,
mark
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: oplot with colours
Next Topic: Question about the installation of IDL AACGM DLM

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

Current Time: Wed Oct 08 18:13:32 PDT 2025

Total time taken to generate the page: 0.00654 seconds