Skip to content

Commit d5fe46d

Browse files
Remove more debug logic
1 parent 1772ba8 commit d5fe46d

File tree

5 files changed

+2
-145
lines changed

5 files changed

+2
-145
lines changed

src/asp/Core/BundleAdjustUtils.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,6 @@ void readMatchPairSigmas(std::string const& sigmaFilename,
804804

805805
matchSigmas[key1] = sigma;
806806
matchSigmas[key2] = sigma;
807-
808-
std::cout << "--added ind1, ind2, sigma: " << ind1 << " " << ind2
809-
<< " " << sigma << "\n";
810807
}
811808

812809
return;

src/asp/IceBridge/nav2cam.cc

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -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

246214
struct 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";

src/asp/Rig/RigRpcDistortion.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,7 @@ void genDistUndistPairs(int num_samples, rig::CameraParameters const& cam_params
367367
Eigen::Vector2d undist_half_size = cam_params.GetUndistortedHalfSize();
368368
Eigen::Vector2d optical_offset = cam_params.GetOpticalOffset();
369369
Eigen::Vector2d focal_length = cam_params.GetFocalVector();
370-
371-
std::cout << "dist size is " << dist_size.transpose() << std::endl;
372-
std::cout << "dist crop size is " << dist_crop_size.transpose() << std::endl;
373-
std::cout << "undist size is " << undist_size.transpose() << std::endl;
374-
std::cout << "dist half size is " << dist_half_size.transpose() << std::endl;
375-
std::cout << "undist half size is " << undist_half_size.transpose() << std::endl;
376-
std::cout << "--num samples is " << num_samples << std::endl;
370+
377371
for (int ix = 0; ix < num_samples; ix++) {
378372
double x = (dist_size[0] - 1.0) * double(ix) / (num_samples - 1.0);
379373
for (int iy = 0; iy < num_samples; iy++) {
@@ -518,6 +512,7 @@ void fitRpcDist(int rpc_degree, int num_samples, rig::CameraParameters const& ca
518512
}
519513
}
520514

515+
// TODO(oalexan1): This needs more work
521516
void evalRpcDistUndist(int num_samples, rig::CameraParameters const& cam_params,
522517
RPCLensDistortion const& rpc) {
523518

@@ -528,7 +523,6 @@ void evalRpcDistUndist(int num_samples, rig::CameraParameters const& cam_params,
528523

529524
double max_err = 0.0;
530525
for (size_t it = 0; it < undist_centered_pixels.size(); it++) {
531-
std::cout << "--broken!" << std::endl;
532526
// Eigen::Vector2d pix = rpc.distort_centered(undist_centered_pixels[it]);
533527
// Eigen::Vector2d pix2 = rpc.undistort_centered(pix);
534528
// max_err = std::max(max_err, (undist_centered_pixels[it] - pix2).norm());

src/asp/Sessions/BundleAdjustSession.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ void matchesFromMapprojImages(int i, int j,
5555

5656
std::string image1_path = opt.image_files[i];
5757
std::string image2_path = opt.image_files[j];
58-
std::cout << "--nw in teset2\n";
5958
if (boost::filesystem::exists(match_filename)) {
6059
vw_out() << "Using cached match file: " << match_filename << "\n";
6160
return;
@@ -241,7 +240,6 @@ void findPairwiseMatches(asp::BaOptions & opt, // will change
241240
inputs_changed = false;
242241
}
243242

244-
std::cout << "--now in test3\n";
245243
if (!inputs_changed) {
246244
vw_out() << "\t--> Using cached match file: " << match_file << "\n";
247245
continue;

src/asp/Tools/orbitviz.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ size_t get_files_from_solver_folder(std::string const& solver_fo
139139
std::vector<ip::InterestPoint> ip1, ip2;
140140
for (size_t m=0; m<num_matches; ++m) {
141141
vw::ip::read_binary_match_file(solver_folder+ "/"+match_files[m], ip1, ip2);
142-
//std::cout << "Read " << ip1.size() << " matches from file " << match_files[m] << std::endl;
143142
if (ip1.size() < MIN_MATCHES)
144143
match_files[m] = "";
145144
}
@@ -149,18 +148,15 @@ size_t get_files_from_solver_folder(std::string const& solver_fo
149148
for (size_t i=0; i<num_images; ++i) {
150149
matched_cameras[i].clear(); // Start with empty list of matches
151150
f1 = strip_directory_and_extension(image_files[i]);
152-
//std::cout <<"f1 = " << f1 << std::endl;
153151
for (size_t j=0; j<num_images; ++j) {
154152
if (i == j) // No self-matching!
155153
continue;
156154
f2 = strip_directory_and_extension(image_files[j]);
157-
//std::cout <<"- f2 = " << f2 << std::endl;
158155
for (size_t m=0; m<num_matches; ++m) {
159156
// If both file names are contained in the match file name,
160157
// make a match between image files i and j
161158
if ( (match_files[m].find(f1) != std::string::npos) &&
162159
(match_files[m].find(f2) != std::string::npos) ) {
163-
//std::cout <<"= MATCH = " << match_files[m] << std::endl;
164160
matched_cameras[i].push_back(j);
165161
match_files[m] = ""; // Clear this name so we don't use the match twice
166162
}

0 commit comments

Comments
 (0)