extracting pixel coordinates [message #94489] |
Mon, 12 June 2017 04:10  |
gunvicsin11
Messages: 93 Registered: November 2012
|
Member |
|
|
Hi all,
I have a 1000 by 1000 pixel array, I need to extract a 1D column
whose start point is (401,642)
and end point is (411,750)
anybody have some idea on this.
thanks
|
|
|
|
Re: extracting pixel coordinates [message #94491 is a reply to message #94489] |
Mon, 12 June 2017 05:19   |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
On Monday, June 12, 2017 at 7:10:47 AM UTC-4, sid wrote:
> Hi all,
> I have a 1000 by 1000 pixel array, I need to extract a 1D column
> whose start point is (401,642)
> and end point is (411,750)
> anybody have some idea on this.
> thanks
I am not sure what do you want. If you want to select the values from the start point to the end point (straight line) you could try this:
xsel=[401:642]
ysel=[411:750]
The problem here is that the selecttion on X does not have the same number of elements as Y, you should therefore interpolate:
xsel=congrid(xsel,n_elements(ysel),/int,/center,/minus_one)
And the result would be:
result=you_array(xsel,ysel)
|
|
|
Re: extracting pixel coordinates [message #94492 is a reply to message #94489] |
Mon, 12 June 2017 08:16  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Monday, June 12, 2017 at 1:10:47 PM UTC+2, sid wrote:
> Hi all,
> I have a 1000 by 1000 pixel array, I need to extract a 1D column
> whose start point is (401,642)
> and end point is (411,750)
> anybody have some idea on this.
> thanks
I'm also not sure what you would like to do, but I wrote a pro some time ago to calculate line profiles. Not only for lines, but also for polylines. Here is the link:
http://idl.marchetto.de/getting-line-profiles/
David also wrote something like this:
http://www.idlcoyote.com/ip_tips/image_profile.html
Cheers,
Helder
|
|
|