Re: Constructing an exact Euclidean distance map [message #83060] |
Tue, 05 February 2013 06:13 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rob Klooster writes:
> Thank you David and Alain for the pointers. I decided to be less "anal" and work with the approximate EDM and compensate for the bias in that model by multiplying all diameters with a fixed value (~0.985).
There you go!
Cheers,
David
P.S. Let's just say one obvious advantage of growing older is that typos
seem to bother me less. So, there is hope! ;-)
--
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: Constructing an exact Euclidean distance map [message #83080 is a reply to message #83061] |
Mon, 04 February 2013 06:30  |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le lundi 4 février 2013 14:57:50 UTC+1, Rob Klooster a écrit :
> The main use i have for an exact EDM is the calculation of the diameter of an inscribed circle of the object of interest. This is equal to twice the maximum of the EDM. Using the approximate EDM from morph_distance leads to a consistent overestimation of this diameter, which is also dependent of the orientation of the object. Maybe you have a better way of getting the inscribed circle?
Depending on the exact formulation of your problem, Voronoï diagram might be useful. See VORONOI and QHULL procedures.
alain.
|
|
|
Re: Constructing an exact Euclidean distance map [message #83082 is a reply to message #83080] |
Mon, 04 February 2013 06:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rob Klooster writes:
> The main use i have for an exact EDM is the calculation of the diameter of an inscribed circle of the object of interest. This is equal to twice the maximum of the EDM. Using the approximate EDM from morph_distance leads to a consistent overestimation of this diameter, which is also dependent of the orientation of the object. Maybe you have a better way of getting the inscribed circle?
Probably not, but if I wanted an inscribed circle, the first thing I
would think about would be an IDLanROI object, whose ComputeMask method
might be able to identify the enclosed pixels for me. Just a thought!
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: Constructing an exact Euclidean distance map [message #83084 is a reply to message #83082] |
Mon, 04 February 2013 05:57  |
Rob Klooster
Messages: 18 Registered: February 2013
|
Junior Member |
|
|
The main use i have for an exact EDM is the calculation of the diameter of an inscribed circle of the object of interest. This is equal to twice the maximum of the EDM. Using the approximate EDM from morph_distance leads to a consistent overestimation of this diameter, which is also dependent of the orientation of the object. Maybe you have a better way of getting the inscribed circle?
|
|
|
Re: Constructing an exact Euclidean distance map [message #83085 is a reply to message #83084] |
Mon, 04 February 2013 05:42  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rob Klooster writes:
> I am looking for a way to get a (near) exact Euclidean distance map (EDM) of a binary image in a fast way. Using morph_distance is fast, but even the "approximate Euclidean distance" is not very close to the exact EDM. I have tried using the brute-force way of looping over all objects, looping over all pixels belonging to the edge of that object and calculating the distance of all pixels to that edge pixel, storing the value if it's smaller than the previous value. This
is obviously quite slow. Any ideas to speed things up?
You could try being less anal. (Difficult to put into practice, alas!)
What are you doing that requires an exact map?
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.")
|
|
|