@@ -128,20 +128,8 @@ double gps_seconds(std::string const& orthoimage_path){
128128 std::tm const *time_out = std::localtime (&time_val);
129129
130130 uint64 weekday = time_out->tm_wday ; // Sunday is 0
131- /*
132- std::cout << "year = " << year << std::endl;
133- std::cout << "month = " << month << std::endl;
134- std::cout << "day = " << day << std::endl;
135- std::cout << "weekday_in = " << time_in.tm_wday << std::endl;
136- std::cout << "weekday_out = " << weekday << std::endl;
137- std::cout << "hour = " << hour << std::endl;
138- std::cout << "min = " << min << std::endl;
139- std::cout << "sec = " << sec << std::endl;
140- std::cout << "fsec = " << fsec << std::endl;
141- */
142131 uint64 all_seconds = weekday*24 *3600 + (uint64)hour*3600 + (uint64)min*60 + (uint64)sec;
143132 double final_time = static_cast <double >(all_seconds) + static_cast <double >(fsec)/100.0 ;
144- // std::cout << "final_time = " << final_time << std::endl;
145133
146134 return final_time;
147135}
@@ -219,29 +207,9 @@ void parse_camera_pose(std::string const& line, Vector3 & xyz, Quat & look, Quat
219207 // - This is relative to the GCC coordinate frame.
220208 ned = Quat (datum_wgs84.lonlat_to_ned_matrix (Vector3 (lon, lat, alt)));
221209
222- // std::cout << "ned matrix " << Quat(ned) << std::endl;
223-
224210 // Get the local rotation matrix at this coordinate.
225211 look = Quat (get_look_rotation_matrix (-heading, -pitch, -roll, rot_order));
226-
227- // std::cout << "--ned " << Quat(ned) << std::endl;
228- // std::cout << "--look is " << Quat(look) << std::endl;
229- // std::cout << "--nedlook is " << Quat(ned*look) << std::endl;
230- // std::cout << "--inv_look *ned is " << inverse(Quat(look))*Quat(ned) << std::endl;
231-
232- // Matrix3x3 rot_mat = look*ned;
233-
234- // std::cout << "rot mat is " << rot_mat << std::endl;
235-
236- // std::cout << "--quat1 " << Quat(look*ned) << std::endl;
237- // std::cout << "--quat " << Quat(ned*look) << std::endl;
238- // std::cout << "--quat3 " << Quat(inverse(ned)*look) << std::endl;
239- // std::cout << "--quat3 " << Quat(inverse(look)*ned) << std::endl;
240- // std::cout << "--quat3 " << Quat(ned*inverse(look)) << std::endl;
241- // std::cout << "--quat3 " << Quat(look*inverse(ned)) << std::endl;
242-
243212}
244-
245213
246214struct Options : public vw ::GdalWriteOptions {
247215 std::string nav_file, input_cam, output_folder;
@@ -588,8 +556,6 @@ int main(int argc, char* argv[]) {
588556 // Get the time boundaries of the current chunk
589557 interpLoader.get_time_boundaries (start, end);
590558
591- // std::cout << "Time range: " << start << " ---- " << end << std::endl;
592-
593559 // When detecting offsets all we want to do is loop through the nav file.
594560 if (opt.detect_offset )
595561 continue ;
@@ -641,9 +607,6 @@ int main(int argc, char* argv[]) {
641607 // vw_out() << "Pitch = " << pitch <<" = "<< pitch*180/3.14159<< std::endl;
642608 // vw_out() << "Heading = " << heading << std::endl;
643609
644- // std::cout << "Ortho time = " << ortho_time << std::endl;
645- // vw_out() << "llh = " << llh_interp << std::endl;
646-
647610 // Now estimate the rotation information
648611
649612 /*
@@ -736,26 +699,10 @@ int main(int argc, char* argv[]) {
736699 // Vector3 north(ned_matrix(0,0), ned_matrix(1,0), ned_matrix(2,0));
737700 // double angle = acos(dot_prod(xDir, north) / (norm_2(north)*norm_2(xDir)));
738701
739- // std::cout << "Nav, est, diff, cam: " << heading <<", "<< angle << ", "<< fabs(heading)-angle << ", " << camera_file << std::endl;
740-
741-
742- // std::cout << "gcc = " << gcc_interp << std::endl;
743- // std::cout << "xDir = " << xDir << std::endl;
744- // std::cout << "yDir = " << yDir << std::endl;
745- // std::cout << "zDir = " << zDir << std::endl;
746-
747- // std::cout << std::endl << "Estimate based matrix " << std::endl;
748- // print_matrix(rotation_matrix_gcc);
749-
750702 // TODO: Clean all this up once we are satisfied with it!
751-
752703 Matrix3x3 M_roll = get_rotation_matrix_roll (roll);
753704 Matrix3x3 M_pitch = get_rotation_matrix_pitch (pitch);
754705
755- // std::cout << "M_roll, M_pitch:\n";
756- // print_matrix(M_roll ); std::cout << std::endl;
757- // print_matrix(M_pitch); std::cout << std::endl;
758-
759706 // Without documentation it is very difficult to determine
760707 // which of these rotation orders is correct!
761708 // - Could be neither since the yaw rotation is already baked in.
@@ -764,84 +711,9 @@ int main(int argc, char* argv[]) {
764711 Matrix3x3 M3 = rotation_matrix_gcc*M_pitch*M_roll; // <-- Best
765712 // Matrix3x3 M4 = rotation_matrix_gcc*M_roll*M_pitch; // <-- Ok
766713
767- // std::cout << "Modified matrices:\n";
768- // print_matrix(M1); std::cout << std::endl;
769- // print_matrix(M2); std::cout << std::endl;
770- // print_matrix(M3); std::cout << std::endl;
771- // print_matrix(M4); std::cout << std::endl;
772-
773- // std::string var_path = output_camera_path.string() + "_";
774- // write_output_camera(gcc_interp, rotation_matrix_gcc, opt.input_cam, var_path + "M0.tsai");
775- // write_output_camera(gcc_interp, M1, opt.input_cam, var_path + "M1.tsai");
776- // write_output_camera(gcc_interp, M2, opt.input_cam, var_path + "M2.tsai");
777- // write_output_camera(gcc_interp, M3, opt.input_cam, var_path + "M3.tsai");
778- // write_output_camera(gcc_interp, M4, opt.input_cam, var_path + "batch_06420_06421_2M4.tsai");
779-
780714 write_output_camera (gcc_interp, M3,
781715 opt.input_cam , output_camera_path.string ());
782716
783- // std::cout << std::endl << "NED matrix " << std::endl;
784- // print_matrix(ned_matrix);
785-
786- // std::cout << std::endl << "ENU matrix " << std::endl;
787- // std::cout << enu_matrix << std::endl << std::endl;
788- /*
789- double yaw = -3.14159 / 2;
790- Matrix3x3 My90 = get_rotation_matrix_yaw(yaw);
791-
792- for (int p=0; p<0; ++p) {
793- Matrix3x3 rotation_matrix_gcc_2 = get_look_rotation_matrix(heading, pitch, roll, p);
794-
795-
796- std::cout << std::endl << "Angle based matrix " << p << std::endl;
797- std::cout << ned_matrix * rotation_matrix_gcc_2 << std::endl;
798-
799- //std::cout << std::endl << "Angle based matrix 90 1" << p << std::endl;
800- //std::cout << My90*(ned_matrix * rotation_matrix_gcc_2) << std::endl;
801-
802- std::cout << std::endl << "Angle based matrix 90 2 " << p << std::endl;
803- std::cout << (ned_matrix * rotation_matrix_gcc_2)*My90 << std::endl;
804-
805-
806- std::cout << std::endl << "Angle based matrix ALT" << p << std::endl;
807- std::cout << rotation_matrix_gcc_2*ned_matrix << std::endl;
808-
809- //std::cout << std::endl << "Angle based matrix ALT 90 1" << p << std::endl;
810- //std::cout << My90*(rotation_matrix_gcc_2*ned_matrix) << std::endl;
811-
812- std::cout << std::endl << "Angle based matrix ALT 90 2 " << p << std::endl;
813- std::cout << (rotation_matrix_gcc_2*ned_matrix)*My90 << std::endl;
814-
815- std::cout << "------------\n";
816-
817-
818- std::cout << std::endl << "Angle based matrix " << p << std::endl;
819- std::cout << enu_matrix * rotation_matrix_gcc_2 << std::endl;
820-
821- //std::cout << std::endl << "Angle based matrix 90 1" << p << std::endl;
822- //std::cout << My90*(enu_matrix * rotation_matrix_gcc_2) << std::endl;
823-
824- std::cout << std::endl << "Angle based matrix 90 2" << p << std::endl;
825- std::cout << (enu_matrix * rotation_matrix_gcc_2)*My90 << std::endl;
826-
827-
828- std::cout << std::endl << "Angle based matrix ALT" << p << std::endl;
829- std::cout << rotation_matrix_gcc_2*enu_matrix << std::endl;
830-
831- //std::cout << std::endl << "Angle based matrix ALT 90 1" << p << std::endl;
832- //std::cout << My90*(rotation_matrix_gcc_2*enu_matrix) << std::endl;
833-
834- std::cout << std::endl << "Angle based matrix ALT 90 2" << p << std::endl;
835- std::cout << (rotation_matrix_gcc_2*enu_matrix)*My90 << std::endl;
836-
837-
838- }
839- std::cout << std::endl << std::endl;
840- */
841- // write_output_camera(gcc_interp, rotation_matrix_gcc,
842- // opt.input_cam, output_camera_path.string());
843-
844-
845717 // Update progress
846718 if (file_index % PRINT_INTERVAL == 0 )
847719 vw_out () << file_index << " files processed.\n " ;
0 commit comments