| Re: IDL routine to fill in gaps in line? / Searching IDL routine libraries? [message #74507 is a reply to message #74411] |
Tue, 18 January 2011 12:05   |
rogass
Messages: 200 Registered: April 2008
|
Senior Member |
|
|
On 18 Jan., 17:24, Robin Wilson <ro...@rtwilson.com> wrote:
> Hi all,
>
> I've recently realised what a wealth of useful code is in the various
> IDL routine libraries available on the internet. However, what I haven't
> found is a very good way of searching them. For example, I would never
> have learnt about the very useful COLLAPSE routine by Marc Buie if he
> hadn't posted about it as a response to one of my questions here.
>
> So, my question is two-fold:
>
> 1. Does anyone know of a routine in any of the IDL user-written
> libraries that fills in gaps in a line on a binary image to make it a
> full and complete line. For example, take in the following input (where
> * is a nonzero element and . is a zero element):
>
> . . * . . .
> . . . . . .
> . . * . . .
> . . . . * .
> . . . . * .
> . . . . * .
>
> And fill in the gaps to make a complete line like:
>
> . . * . . .
> . . * . . .
> . . * * * .
> . . . . * .
> . . . . * .
> . . . . * .
>
> 2. I have a suspicion that the code I need to do the above is out there
> somewhere. Does anyone have any particularly useful tips for searching
> all of the IDL libraries on the internet to find routines you need?
>
> Cheers,
>
> Robin
>
> -------
> PhD Student
> University of Southampton, UK
Hi, for searching you might use this one: http://www.astro.washington.edu/docs/idl/htmlhelp/
As Paolo stated you have to define your problem more precisely.
However, it seems to me that you want to apply an algorithm which
searches on the one hand a tree and on the other hand an
interpolation. Maybe, you can try the following:
0. refine your problem
1. start at a random, boundary near data point
2. compute euclidic distances by 'distance_measure'
3. search for next data point and mark last one as visited
3.a) next data point distance greater than sqrt(2)->interpolate
missing data points of shortest path (incorporate all data points
which are close enough to some extend and not interpolated)
3.b) continue
4. 'Canny' and 'dilate' or 'erode' or 'thin' your data to remove
'spikes'
Cheers
CR
|
|
|
|