| 1 |
#include <grass/gis.h> |
| 2 |
#include <grass/imagery.h> |
| 3 |
#include "mat.h" |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#define INITIAL_X_VAR 500 |
| 8 |
#define INITIAL_Y_VAR 500 |
| 9 |
#define INITIAL_Z_VAR 1000 |
| 10 |
#define INITIAL_OMEGA_VAR 0.01 |
| 11 |
#define INITIAL_PHI_VAR 0.01 |
| 12 |
#define INITIAL_KAPPA_VAR 0.1 |
| 13 |
|
| 14 |
|
| 15 |
struct Ortho_Image_Group_Ref { |
| 16 |
int nfiles; |
| 17 |
struct Ortho_Image_Group_Ref_Files { |
| 18 |
char name[GNAME_MAX]; |
| 19 |
char mapset[GMAPSET_MAX]; |
| 20 |
} *file; |
| 21 |
struct Ortho_Ref_Color { |
| 22 |
unsigned char *table; |
| 23 |
unsigned char *index; |
| 24 |
unsigned char *buf; |
| 25 |
int fd; |
| 26 |
CELL min, max; |
| 27 |
int n; |
| 28 |
} red, grn, blu; |
| 29 |
}; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
struct Ortho_Camera_File_Ref { |
| 35 |
char cam_name[30]; |
| 36 |
char cam_id[30]; |
| 37 |
double Xp; |
| 38 |
double Yp; |
| 39 |
double CFL; |
| 40 |
int num_fid; |
| 41 |
struct Fiducial { |
| 42 |
char fid_id[30]; |
| 43 |
double Xf; |
| 44 |
double Yf; |
| 45 |
} fiducials[20]; |
| 46 |
}; |
| 47 |
|
| 48 |
|
| 49 |
struct Ortho_Photo_Points { |
| 50 |
int count; |
| 51 |
double *e1; |
| 52 |
double *n1; |
| 53 |
double *z1; |
| 54 |
double *e2; |
| 55 |
double *n2; |
| 56 |
double *z2; |
| 57 |
int *status; |
| 58 |
}; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
struct Ortho_Control_Points { |
| 64 |
int count; |
| 65 |
double *e1; |
| 66 |
double *n1; |
| 67 |
double *z1; |
| 68 |
double *e2; |
| 69 |
double *n2; |
| 70 |
double *z2; |
| 71 |
int *status; |
| 72 |
}; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
struct Ortho_Camera_Exp_Init { |
| 78 |
double XC_init; |
| 79 |
double YC_init; |
| 80 |
double ZC_init; |
| 81 |
double omega_init; |
| 82 |
double phi_init; |
| 83 |
double kappa_init; |
| 84 |
double XC_var; |
| 85 |
double YC_var; |
| 86 |
double ZC_var; |
| 87 |
double omega_var; |
| 88 |
double phi_var; |
| 89 |
double kappa_var; |
| 90 |
int status; |
| 91 |
}; |
| 92 |
|
| 93 |
struct Ortho_Image_Group { |
| 94 |
char name[GNAME_MAX]; |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
struct Ref group_ref; |
| 101 |
struct Ortho_Camera_File_Ref camera_ref; |
| 102 |
struct Ortho_Photo_Points photo_points; |
| 103 |
struct Ortho_Control_Points control_points; |
| 104 |
struct Ortho_Camera_Exp_Init camera_exp; |
| 105 |
int ref_equation_stat; |
| 106 |
int con_equation_stat; |
| 107 |
double E12[3], N12[3], E21[3], N21[3], Z12[3], Z21[3]; |
| 108 |
double XC, YC, ZC, omega, phi, kappa; |
| 109 |
MATRIX M, MI; |
| 110 |
}; |
| 111 |
|
| 112 |
|
| 113 |
int I_new_con_point(struct Ortho_Control_Points *, double, double, double, |
| 114 |
double, double, double, int); |
| 115 |
int I_get_con_points(char *, struct Ortho_Control_Points *); |
| 116 |
int I_put_con_points(char *, struct Ortho_Control_Points *); |
| 117 |
int I_convert_con_points(char *, struct Ortho_Control_Points *, |
| 118 |
struct Ortho_Control_Points *, double[3], double[3]); |
| 119 |
|
| 120 |
int I_compute_ref_equations(struct Ortho_Photo_Points *, double[3], double[3], |
| 121 |
double[3], double[3]); |
| 122 |
|
| 123 |
int I_compute_ortho_equations(struct Ortho_Control_Points *, |
| 124 |
struct Ortho_Camera_File_Ref *, |
| 125 |
struct Ortho_Camera_Exp_Init *, double *, |
| 126 |
double *, double *, double *, double *, double *, |
| 127 |
MATRIX *, MATRIX *); |
| 128 |
int I_ortho_ref(double, double, double, double *, double *, double *, |
| 129 |
struct Ortho_Camera_File_Ref *, double, double, double, MATRIX); |
| 130 |
int I_inverse_ortho_ref(double, double, double, double *, double *, double *, |
| 131 |
struct Ortho_Camera_File_Ref *, double, double, double, |
| 132 |
MATRIX); |
| 133 |
void I_ortho_panorama(void); |
| 134 |
|
| 135 |
|
| 136 |
int I_new_ref_point(struct Ortho_Photo_Points *, double, double, double, double, |
| 137 |
int); |
| 138 |
int I_get_ref_points(char *, struct Ortho_Photo_Points *); |
| 139 |
int I_put_ref_points(char *, struct Ortho_Photo_Points *); |
| 140 |
|
| 141 |
|
| 142 |
int I_read_cam_info(FILE *, struct Ortho_Camera_File_Ref *); |
| 143 |
int I_new_fid_point(struct Ortho_Camera_File_Ref *, char[30], double, double); |
| 144 |
int I_write_cam_info(FILE *, struct Ortho_Camera_File_Ref *); |
| 145 |
int I_get_cam_info(char *, struct Ortho_Camera_File_Ref *); |
| 146 |
int I_put_cam_info(char *, struct Ortho_Camera_File_Ref *); |
| 147 |
|
| 148 |
|
| 149 |
int I_read_init_info(FILE *, struct Ortho_Camera_Exp_Init *); |
| 150 |
int I_write_init_info(FILE *, struct Ortho_Camera_Exp_Init *); |
| 151 |
int I_get_init_info(char *, struct Ortho_Camera_Exp_Init *); |
| 152 |
int I_put_init_info(char *, struct Ortho_Camera_Exp_Init *); |
| 153 |
|
| 154 |
#include <grass/ortholib.h> |