## Zero-crossing detector

### Zero-crossing detector

G'Day

I have ended up with a floating point image ranging from about -1.0 to 1.0.
Does someone have a good zero-crossing detector routine I could use ? If
it also includes thinning the resultant it would be perfect. Any help,
pointers to software etc.. would be greatly appreciated.

best regards
Ata <(|)>.

P.S. [S] == search for :-)

Mail          Dr Ata Etemadi, Blackett Laboratory,
Imperial College of Science and Technology,
Prince Consort Road, London SW7 2BZ, ENGLAND
Phone         +44 (0)171 594 7678
Fax           +44 (0)171 594 7772 Attn. Dr Ata Etemadi,
Telex         929484 (IMPCOL G)   Attn. Dr Ata Etemadi,

WWW           <URL:http://crab.sp.ph.ic.ac.uk/~atae>

### Zero-crossing detector

>G'Day

>I have ended up with a floating point image ranging from about -1.0 to 1.0.
>Does someone have a good zero-crossing detector routine I could use ? If
>it also includes thinning the resultant it would be perfect. Any help,
>pointers to software etc.. would be greatly appreciated.

You can check for pairs of adjacent pixels with sign changes and mark
both pixels in the pair.  There are some standard 2D thinning algorithms
to be found in image processing books.  I have nD thinning algorithms
at ftp://ftp.cs.unc.edu/pub/users/eberly/magic3/{inc304.zip,src304.zip}.
Files are in pkzip format.  I think some subdirectories have the unzipped
code.  The files of interest are discrete.{h,c} (C++ code).

An alternative is to fit the image with a spline (code for this is
spline.{h,c}, spline2.{h.c}) for a continuous representation.  Find a
pair of adjacent pixels with sign change.  Use bisection to find a zero.
Solve the differential equation

dx/dt = f_y(x,y),  dy/dt = -f_x(x,y)

with initial data given by the zero point found by bisection.  Code for
this is ode.{h,c} and some solver (euler.*, midpoint.*, rk4.*, rk4adapt.*).
Repeat this process for all such pairs of pixels with a sign change (but