11 #define PI 3.1415926535
22 #define FC_VERT_LINE 1
23 #define FC_HORIZ_LINE 2
25 #define FC_SQUARE_BOX 4
32 #define DMAX2 DMAX*DMAX
33 #define DMIN2 (DMAX-2)*(DMAX-2)
34 #define ALPHA_MAX 160.0*PI/180.0
36 #define MIN_LINE_REZID 1.2
38 #define MIN_LINE_INLIER 15
40 #define M_FRM_NO_POINT -10000000
42 #define AUGMENT_MIN_CORN 25
43 #define AUGMENT_LINE_STEP 10
45 extern double bgSign(
double);
46 extern int bgSolveCubic(
double,
double,
double,
double,
double&,
double&,
double&);
47 extern inline int bgRound(
double);
48 extern inline int bgRoundSign(
double);
49 extern double bgMedian(
double*,
int,
double);
50 extern inline double bgMedianToSigmaGaussian(
double);
51 extern void bgSort(
double*,
int);
54 extern void bgZoomIn(
unsigned char**,
unsigned char*,
int,
int,
int,
bool);
55 extern void bgZoomOut(
unsigned char**,
unsigned char*,
int,
int,
int,
bool);
58 extern void BgAddExtension(
char**,
char*);
60 extern void bgLog(
const char*, ...);
61 extern void bgLogFile(
const char*, ...);
62 extern int write_pgm_image(
const char *outfilename,
unsigned char *image,
int rows,
63 int cols,
char *comment,
int maxval);
64 extern void write_MATLAB_ASCII(
char *filename,
float *data,
int rows,
int cols);
65 extern "C" int lmdif(
int m,
int n,
double x[],
double fvec[] ,
double ftol,
double xtol,
double gtol,
int maxfev,
66 double epsfcn,
double diag[],
int mode,
double factor,
int nprint,
int *info,
int *nfev,
67 double fjac[],
int ldfjac,
int ipvt[],
double qtf[],
double wa1[],
double wa2[] ,
68 double wa3[],
double wa4[]);
69 extern void timer_start();
70 extern void timer_stop();