1 #include "global.h"
2 
3 /* compute target to photo equation */
Compute_ortho_equation(struct Ortho_Image_Group * group)4 int Compute_ortho_equation(struct Ortho_Image_Group *group)
5 {
6     double e0, e1, e2, n0, n1, n2, z1, z2;
7     int status, i;
8     struct Ortho_Control_Points temp_points;
9 
10     /* alloc and fill temp control points */
11     temp_points.count = 0;
12     temp_points.status = NULL;
13     temp_points.e1 = NULL;
14     temp_points.n1 = NULL;
15     temp_points.z1 = NULL;
16     temp_points.e2 = NULL;
17     temp_points.n2 = NULL;
18     temp_points.z2 = NULL;
19 
20     /* e0, n0, equal photo coordinates not image coords */
21     for (i = 0; i < group->control_points.count; i++) {
22 	status = group->control_points.status[i];
23 	e1 = group->control_points.e1[i];
24 	n1 = group->control_points.n1[i];
25 	z1 = group->control_points.z1[i];
26 	e2 = group->control_points.e2[i];
27 	n2 = group->control_points.n2[i];
28 	z2 = group->control_points.z2[i];
29 
30 	/* image to photo transformation */
31 	I_georef(e1, n1, &e0, &n0, group->E12, group->N12, 1);
32 	I_new_con_point(&temp_points, e0, n0, z1, e2, n2, z2, status);
33     }
34 
35 
36     group->con_equation_stat = I_compute_ortho_equations(&temp_points,
37 							 &group->camera_ref,
38 							 &group->camera_exp,
39 							 &group->XC, &group->YC,
40 							 &group->ZC,
41 							 &group->omega,
42 							 &group->phi,
43 							 &group->kappa,
44 							 &group->M,
45 							 &group->MI);
46 
47     return 0;
48 }
49 
50 /* compute photo to image equation */
Compute_ref_equation(struct Ortho_Image_Group * group)51 int Compute_ref_equation(struct Ortho_Image_Group *group)
52 {
53     group->ref_equation_stat = I_compute_ref_equations(&group->photo_points,
54 						       group->E12, group->N12,
55 						       group->E21, group->N21);
56 
57     return 0;
58 }
59