home *** CD-ROM | disk | FTP | other *** search
- /*
- * xcc.h
- *
- * Practical Algorithms for Image Analysis
- *
- * Copyright (c) 1997, 1998, 1999 MLMSoftwareGroup, LLC
- */
-
- /*
- * structure defs for xcc.c and related modules; required list structures
- * are defined in lldef.h
- */
-
- #ifndef _XCC_H_
- #define _XCC_H_
-
- #include "ip.h"
-
- #define SIGN(a) ( ((a) == 0.0) ? 0 : ( ((a) < 0.0) ? -1 : 1 ) )
- #define F_TO_INT(a) ( ((a)-(int)(a)>0.5) ? ((int)(a)+1) : ((int)(a)) )
- #define MIN(a, b) ( ((a)<(b)) ? (a) : (b) )
- #define SQR(a) ( (a)*(a) )
-
-
- #define MAX_REC_SIZE 1200 /* max number of disks */
-
- typedef struct edge_tuple { /* runs of ON-pixels on given scan row */
- short cl, cr; /* pair of y-coord, delimiting run */
- Boolean status; /* Matched; UnMatched */
- } Edge_Tpl;
-
- typedef struct triple { /* 3-tuple: disk chords */
- short r;
- short cl, cr;
- } Trpl;
-
- struct disk {
- Trpl *chords; /* array of (disk) chords, of form (r, cl, cr) */
- int nch; /* numb of chords (upper bnd set by 2*R/DELTA_i) */
- Sp ctr; /* center position */
- int rad; /* actual radius, based on sample of edge points */
- Boolean Status; /* Active (Incomplete), InActive (Complete) */
- Boolean Type; /* Accept, Reject */
- };
-
-
- /* function prototypes */
- /* xcc.c */
- extern void displ_disk_contours (struct linklist *list, Image * imgIO, int value);
- extern void init_dll (struct linklist *disk_list);
- extern void init_etll (struct linklist *edge_tuple_list);
- extern int rm_llistlink (struct linklist *list);
- extern void tshow_disk_list (struct linklist *list);
- extern void show_disk_list (struct linklist *list);
- extern float update_disk_dia (struct linklist *list);
- extern void gprintf (FILE * fpOut, char *fmt,...);
- extern void exitmess (char *prompt, int status);
- extern void fail_alloc (char *str, int status);
- extern void usage (char *progname);
- extern void main (int argc, char **argv);
- /* circ_geom.c */
- extern double slopev (struct spoint pt1, struct spoint pt2);
- extern struct spoint eval_centroid (int *x, int *y, int n);
- extern struct spoint eval_ctr (struct spoint *v, int n);
- extern int eval_rad (struct disk *cdsk);
- extern int eval_circ (struct disk *cdsk);
- /* cc.c */
- extern int init_disk (struct disk *ndsk, int nch);
- extern int close_disk (struct disk *cdsk);
- extern int flag_disk (struct disk *cdsk);
- extern void fetch_edge_det (float *ef, int nf);
- extern void edge_det (unsigned char *y, int n, float *f, int nf);
- extern double pbi_ctr (int ir, struct edge_tuple *cetpl,
- struct triple *cdsk_lchrd);
- extern Boolean insp_Adsk (int ir,
- struct edge_tuple *cetpl, struct disk *cdsk);
- extern int find_cdsk_lchrd (int ir, struct disk *cdsk);
- extern struct linktype *find_all_Adsks (struct linklist *dll);
- extern struct linktype *find_next_Adsk (struct linklist *dll);
- extern void ndsk_to_dll (char *ndsk, struct linklist *dll);
- extern Boolean chord_to_Adsk (int ir, int nch, struct edge_tuple *cetpl,
- struct disk *cdsk, int disk_type, int ncch);
- extern int find_segm_shift (struct triple *chrd, struct edge_tuple *cetpl);
- extern int find_segm_ovlp (struct triple *chrd, struct edge_tuple *cetpl);
- extern int update_disk_list (int ir, int nch,
- struct linklist *dll, struct linklist *etll);
- extern Boolean ReptSegmStatus (struct edge_tuple *letpl, int pix);
- extern int encode_row (unsigned char *row, int nc, struct linklist *etll, int gray_lev);
- /* test_xcc.c */
- extern int fetch_test_parms (FILE * file, float *dsk_dia,
- int *del_ir, int *nch, int *ir_base);
- extern int fetch_test_row (FILE * file, struct linklist *etll);
-
- #endif /*_XCC_H_ */ :
-