edgen - Edge library routines.
NAME
libEdgenHD.a,
sobel,
gauss,
SepOpt,
Opt1D,
Opt2D,
derich,
diff,
work_out_grad,
non_max,
spaceck,
ppfit,
HysteresisThresh,
Do_link,
WriteEdgeStrAndDesc.,
this manual gives the various routines that can be used by linking
libEdgenHD.a to your program and including the header files.
Two points need to be pointed out. Firstly, in most cases, the outputs
need to be allocated for prior to processing. Secondly, functions parameters
are generally arranged as inputs to function, output from functions and
required parameters.
"edgen.h"
"petrou.h" need to be included when compiling your programs.
void sobel(FARY* image, FARY* dx, FARY* dy)
void gauss(FARY* image, FARY* dx, FARY* dy, int mask_len, float tau)
void SepOpt(FARY* image, FARY* dx, FARY* dy, int mask_len,float s)
void Opt1D(FARY* image,FARY* dx, FARY* dy, int mask_len, float s)
void Opt2D(FARY* image, FARY* dx, FARY* dy, FARY* smooImage,
int mask_len, float s)
void derich(FARY* image,FARY* dx,FARY* dy, float alpha, float omega)
void diff(FARY* image, FARY* dx, FARY* dy)
work_out_grad(FARY* dx, FARY* dy, FARY* grad)
void non_max(FARY* dx, FARY* dy, FARY *grad,
FARY* max_SuppGrad,
float *mean2, int four_con)
void spaceck(FARY* dx,FARY* dy,FARY* grad,
FARY* maxSuppGrad,
FARY* xOfset,FARY* yOfset)
void ppfit(FARY *dx, FARY *dy, FARY *grey,t_LL allStrs,
FARY* dxOfSet, FARY* dyOffset)
void HysteresisThresh (FARY *grad, BARY* edgeImage, double up_thr, double low_thr)
t_LL Do_link(BARY *edgeImage)
void WriteEdgeStrAndDesc(char *gfout,t_LL allStrings, FARY *dx, FARY *dy,
FARY *max_supp_grad, FARY *xOfset, FARY *yOfset,
int dirOut, int magOut, int strNumOut, int impDirSw)
<h3> Convolution routines: </h3>
Having read the image into a FARY type structure (see ary manual for
further details), the following convolutions can be performed to obtain
dx and dy which are themselves FARYs (note that memory needs to be
allocated for dx, dy prior to calling the routine):
void sobel(FARY* image, FARY* dx, FARY* dy);
void gauss(FARY* image, FARY* dx, FARY* dy, int mask_len, float tau)
void SepOpt(FARY* image, FARY* dx, FARY* dy, int mask_len,float s)
void Opt1D(FARY* image,FARY* dx, FARY* dy, int mask_len, float s)
void Opt2D(FARY* image, FARY* dx, FARY* dy, FARY* smooImage,
int mask_len, float s)
void derich(FARY* image,FARY* dx,FARY* dy, float alpha, float omega)
void diff(FARY* image, FARY* dx, FARY* dy);
Given dx and dy, the following routine works out the gradient image.
The gradient image is a FARY which needs to have allocated memory for.
work_out_grad(FARY* dx, FARY* dy, FARY* grad)
Two non-maximum routines are available both requiring dx,dy and grad information.
The output is put in a FARY structure which should have memory
allocated for.
void non_max(FARY* dx, FARY* dy, FARY *grad,
FARY* max_SuppGrad,
float *mean2, int four_con)
or for subpixel accuracy (note xOfset and yOfset are FARYs which need to
be allocated for). They contain the exact location of the edge coordinate.
void spaceck(FARY* dx,FARY* dy,FARY* grad,
FARY* maxSuppGrad,
FARY* xOfset,FARY* yOfset)
void ppfit(FARY *dx, FARY *dy, FARY *grey,t_LL allStrs,
FARY* dxOffset, FARY* dyOffset)
This routine takes in the non-maximum suppressed image and performs
Cannys hysteresis thresholding. The output is in a BARY (Byte Ary) structure
and has zeros except at edge locations where it has values of 1.
void HysteresisThresh (FARY *grad, BARY* edgeImage, double up_thr, double low_thr)
This routine outputs connected components. Its retuens a list of
connected strings. Each string is a list of points of type (t_i2D) which
is a structure containning x, y and th.
t_LL Do_link(BARY* edgeImage)
This routine takes in edge strings and writes the data to an o/p .gf file.
It also (for speed) performs the direction operation.
void WriteEdgeStrAndDesc(char *gfout,t_LL allStrings, FARY *dx, FARY *dy,
FARY *max_supp_grad, FARY *xOfset, FARY *yOfset,
int dirOut, int magOut, int strNumOut, int impDirSw)
Any switch which is not used can be set to 0.
Homam Dabis, University of Surrey, h.dabis@ee.surrey.ac.uk.
18-Oct-94. Automatically converted by man2html,
written by G.Matas (g.matas@ee.surrey.ac.uk)