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

Home » Public Forums » archive » How to choose the pixels along a curve in an image
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
How to choose the pixels along a curve in an image [message #88086] Wed, 19 March 2014 09:35 Go to next message
spright is currently offline  spright
Messages: 4
Registered: March 2014
Junior Member
Hi guys,
I want to get the values of pixels along a curve in an image. Could anyone give some suggestions? This curve may be got by a polynomial fit to a few points on the image.

For pixels along a straight line, it is easier as I can rotate the image to leave the line in horizontal or vertical direction and choose these pixels in an array of the image, like img[*,n]. But seems it is difficult for the one with curve.

Any suggestions? Thanks.
Re: How to choose the pixels along a curve in an image [message #88087 is a reply to message #88086] Wed, 19 March 2014 10:03 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
spright writes:

> I want to get the values of pixels along a curve in an image. Could anyone give some suggestions? This curve may be got by a polynomial fit to a few points on the image.
>
> For pixels along a straight line, it is easier as I can rotate the image to leave the line in horizontal or vertical direction and choose these pixels in an array of the image, like img[*,n]. But seems it is difficult for the one with curve.
>
> Any suggestions?

If you really mean "pixels", I would draw the curve in a blank pixmap
window, take a 2D snapshot of the window, and use Where to tell me which
pixels in that window were different from the background color.

Armed with that information, it would be easy to convert the pixel
values into the coordinate system of the image (I like to use
Value_Locate for this if there isn't a one-to-one correspondence between
the image and the display) and fish out the underlying image values.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: How to choose the pixels along a curve in an image [message #88089 is a reply to message #88087] Wed, 19 March 2014 11:46 Go to previous messageGo to next message
spright is currently offline  spright
Messages: 4
Registered: March 2014
Junior Member
Thanks Dr. Fanning. I want to know that if there is a way to make a curved feature in an image into straight?
Re: How to choose the pixels along a curve in an image [message #88091 is a reply to message #88089] Wed, 19 March 2014 12:20 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
spright writes:

> Thanks Dr. Fanning. I want to know that if there is a way to make a curved feature in an image into straight?

I'm sure there is. Photoshop Lightroom knows how to do this quite
easily. I don't know how to do it. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: How to choose the pixels along a curve in an image [message #88092 is a reply to message #88091] Wed, 19 March 2014 12:35 Go to previous messageGo to next message
spright is currently offline  spright
Messages: 4
Registered: March 2014
Junior Member
Ok, thanks Dr. Fanning. It seems very tricky though.

在 2014年3月19日星期三UTC-5下午2时20分24秒,David Fanning写道:
> spright writes:
>
>
>
>> Thanks Dr. Fanning. I want to know that if there is a way to make a curved feature in an image into straight?
>
>
>
> I'm sure there is. Photoshop Lightroom knows how to do this quite
>
> easily. I don't know how to do it. :-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: How to choose the pixels along a curve in an image [message #88095 is a reply to message #88091] Wed, 19 March 2014 13:52 Go to previous messageGo to next message
spright is currently offline  spright
Messages: 4
Registered: March 2014
Junior Member
btw, wrap_tri might work for this purpose.

在 2014年3月19日星期三UTC-5下午2时20分24秒,David Fanning写道:
> spright writes:
>
>
>
>> Thanks Dr. Fanning. I want to know that if there is a way to make a curved feature in an image into straight?
>
>
>
> I'm sure there is. Photoshop Lightroom knows how to do this quite
>
> easily. I don't know how to do it. :-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: How to choose the pixels along a curve in an image [message #88135 is a reply to message #88086] Sat, 22 March 2014 20:58 Go to previous messageGo to next message
kagoldberg is currently offline  kagoldberg
Messages: 26
Registered: November 2012
Junior Member
If I understand what you're looking for, the interpolate() function should work for you. You can take your 2D images, and extract an arbitrary number of output values at positions you specify along an (x,y) path.
Re: How to choose the pixels along a curve in an image [message #88136 is a reply to message #88135] Sun, 23 March 2014 09:53 Go to previous message
sprightzhu is currently offline  sprightzhu
Messages: 2
Registered: March 2014
Junior Member
On Saturday, March 22, 2014 10:58:19 PM UTC-5, kagol...@lbl.gov wrote:
> If I understand what you're looking for, the interpolate() function should work for you. You can take your 2D images, and extract an arbitrary number of output values at positions you specify along an (x,y) path.

Great thanks for this. I will look into it.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: -32768
Next Topic: file in use by another program

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

Current Time: Wed Oct 08 15:13:09 PDT 2025

Total time taken to generate the page: 0.00490 seconds