Go to the documentation of this file. 32 #define EXECUTE_INFO \ 33 std::cout << std::endl \ 34 << " ------------------------------------------------------------------ " << std::endl \ 35 << " Video Stabilization." << std::endl \ 36 << " --> Running Armadillo version: " << arma::arma_version::as_string() << std::endl \ 37 << " --> Running OpenCV version: " << CV_VERSION << std::endl \ 38 << " --> Project webpage (database, source code and results): " << std::endl \ 39 << " \" www.verlab.dcc.ufmg.br/semantic_hyperlapse_project \" " << std::endl \ 40 << " --> If you are using it to academic purposes, please cite: " << std::endl \ 41 << " \" Autores. Titulo. Conferencia. Ano \" " << std::endl \ 42 << " --> If you need help feel free to contact us: " << std::endl \ 43 << " \" michel.silva66@gmail.com \" and \" washington.ramos@outlook.com \" " << std::endl \ 44 << " --> Institution: " << std::endl \ 45 << " VerLab @ Universidade Federal de Minas Gerais (UFMG), Brazil. " << std::endl \ 46 << " ------------------------------------------------------------------ " << std::endl \ 49 #define EXECUTE_EXPERIMENT_ID \ 50 std::cout << std::endl \ 51 << " Running exepriment: " << argv[1] << " | Experiment ID: " << experiment_settings.id << std::endl \ 54 #define EXECUTE_VIEW \ 56 imshow( "Homography", result ); \ 57 cv::waitKey(VIEW_DELAY); \ 60 #define EXECUTE_IMAGE_STUFFS( string_length , frame ) \ 61 if ( FRAME_NUMBER_RESULT ) \ 62 cv::putText(result, SSTR(std::setfill('0') << std::setw(string_length) << frame), cv::Point(150,150), cv::FONT_HERSHEY_TRIPLEX, 2.5, cv::Scalar(0,0,255)); \ 63 if ( experiment_settings.save_video_in_disk ){ \ 64 result = result( crop_area ); \ 65 save_video << result; \ 68 cv::rectangle( result , view_area , cv::Scalar(255,0,0) , 2 ) ; \ 69 cv::rectangle( result , crop_area , cv::Scalar(0,255,0) , 2 ) ; \ 70 cv::rectangle( result , drop_area , cv::Scalar(0,0,255) , 2 ) ; \ 73 #define EXECUTE_IMAGE_RECONSTRUCTION \ 75 if ( ! imageReconstructionMask(current_frame , homography_matrix, selected_frames[i], experiment_settings, crop_area, reconstructed_frame) ) \ 76 if ( DEBUG_FRAME_STATUS ) \ 77 std::cout << " [!] Failled in reconstruct the image. " << std::endl; \ 78 result = reconstructed_frame.clone(); \ 79 num_of_reconstructed_frames++; 81 #define EXECUTE_IMAGE_CONDITIONAL_ACTIONS \ 82 if ( getAreaRatio( current_frame , homography_matrix , crop_area ) > MAXIMUM_AREA_ALLOWED ) { \ 83 if ( getAreaRatio( current_frame , homography_matrix , drop_area ) > MAXIMUM_AREA_ALLOWED ) { \ 84 log_file << " Frame : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [D] Dropped, a new one will be selected in the original video." << std::endl; \ 85 if ( DEBUG_FRAME_STATUS ) \ 86 std::cout << " i : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [D] Dropped, a new one will be selected in the original video." << std::endl; \ 87 num_of_dropped_frames++; \ 89 log_file << " Frame : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [R] Reconstructed using the original video." << std::endl; \ 90 if ( DEBUG_FRAME_STATUS ) \ 91 std::cout << " i : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [R] Reconstructed using the original video." << std::endl; \ 92 EXECUTE_IMAGE_RECONSTRUCTION \ 95 log_file << " Frame : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [K] Kept." << std::endl; \ 96 if ( DEBUG_FRAME_STATUS ) \ 97 std::cout << " i : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [K] Kept." << std::endl; \ 98 num_of_good_frames++; \ 101 #define SSTR( x ) static_cast< std::ostringstream & >( \ 102 ( std::ostringstream() << std::dec << x ) ).str()