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

Home » Public Forums » archive » Compute Euclidean distances
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Compute Euclidean distances [message #54151] Fri, 25 May 2007 00:46 Go to previous message
lbusett@yahoo.it is currently offline  lbusett@yahoo.it
Messages: 30
Registered: February 2006
Member
Hi all,

I have the following problem: given an image of about 700000
pixels, i need to calculate the distance between each pixel and about
150 points of known coordinates. Actually, I'm actually using a simple
for loop like that:


; map_x = array of east coordinates of each pixel (n =
700000)
; map_y = array of north coordinate of each pixel (n
= 700000)
; east = array of east coordinates of the each point
(n= 150)
; north = array of north coordinates of the each
point (n= 150)
; dist_pt ="results" array (n = 700000*150)
;
for point= 0, n_points-1 do begin

dist_x = (map_x - East [point])^2
dist_y =(map_y - North [point])^2
dist_pt [*,point] = sqrt ( dist_x + dist_y)

endfor

but the processing is quite slow (more than one minute on my PC), so
i'd like to ask you if there is a way to increase the speed of the
process.

Thanks in advance for the help,

Lorenzo Busetto
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Bottom of GUI not visible
Next Topic: X Windows

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

Current Time: Wed Oct 08 17:18:24 PDT 2025

Total time taken to generate the page: 0.00453 seconds