EgoVideoStabilizer  1.0.0
execute_commands.h File Reference

Macro with specific codes. More...

#include <sstream>
#include <stdio.h>
Include dependency graph for execute_commands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EXECUTE_INFO
 
#define EXECUTE_EXPERIMENT_ID
 
#define EXECUTE_VIEW
 
#define EXECUTE_IMAGE_STUFFS(string_length, frame)
 
#define EXECUTE_IMAGE_RECONSTRUCTION
 
#define EXECUTE_IMAGE_CONDITIONAL_ACTIONS
 
#define SSTR(x)
 

Detailed Description

Macro with specific codes.

Macro Definition Documentation

#define EXECUTE_EXPERIMENT_ID
Value:
std::cout << std::endl \
<< " Running exepriment: " << argv[1] << " | Experiment ID: " << experiment_settings.id << std::endl \
<< std::endl; \
EXPERIMENT experiment_settings
Definition: main.cpp:59
std::string id
Definition: experiment_struct.h:33
#define EXECUTE_IMAGE_CONDITIONAL_ACTIONS
Value:
if ( getAreaRatio( current_frame , homography_matrix , crop_area ) > MAXIMUM_AREA_ALLOWED ) { \
if ( getAreaRatio( current_frame , homography_matrix , drop_area ) > MAXIMUM_AREA_ALLOWED ) { \
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; \
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; \
num_of_dropped_frames++; \
} else { \
log_file << " Frame : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [R] Reconstructed using the original video." << std::endl; \
std::cout << " i : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [R] Reconstructed using the original video." << std::endl; \
EXECUTE_IMAGE_RECONSTRUCTION \
} \
} else { \
log_file << " Frame : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [K] Kept." << std::endl; \
std::cout << " i : " << SSTR ( std::setfill('0') << std::setw(log_number_length) << i ) << " | [K] Kept." << std::endl; \
num_of_good_frames++; \
}
#define DEBUG_FRAME_STATUS
Print variable values for each step of processing in the main cpp file.
Definition: define.h:42
double getAreaRatio(const cv::Mat &image_src, const cv::Mat &homography_matrix, const cv::Rect &frame_limits)
Function that calculates the loss(%) of the homography transformation in a ROI.
Definition: homography.cpp:523
int log_number_length
Definition: main.cpp:52
#define MAXIMUM_AREA_ALLOWED
Maximum area allowed to check if an image need to continue on being reconstructed.
Definition: define.h:54
#define SSTR(x)
Definition: execute_commands.h:101
#define EXECUTE_IMAGE_RECONSTRUCTION
Value:
/*if ( ! imageReconstruction(result, selected_frames[i], experiment_settings, crop_area, reconstructed_frame) )*/ \
if ( ! imageReconstructionMask(current_frame , homography_matrix, selected_frames[i], experiment_settings, crop_area, reconstructed_frame) ) \
std::cout << " [!] Failled in reconstruct the image. " << std::endl; \
result = reconstructed_frame.clone(); \
num_of_reconstructed_frames++;
#define DEBUG_FRAME_STATUS
Print variable values for each step of processing in the main cpp file.
Definition: define.h:42
EXPERIMENT experiment_settings
Definition: main.cpp:59
#define EXECUTE_IMAGE_STUFFS (   string_length,
  frame 
)
Value:
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)); \
result = result( crop_area ); \
save_video << result; \
saved_frames++; \
} else { \
cv::rectangle( result , view_area , cv::Scalar(255,0,0) , 2 ) ; \
cv::rectangle( result , crop_area , cv::Scalar(0,255,0) , 2 ) ; \
cv::rectangle( result , drop_area , cv::Scalar(0,0,255) , 2 ) ; \
}
EXPERIMENT experiment_settings
Definition: main.cpp:59
bool save_video_in_disk
After calculte the master frames, do you want to save it in a file? After you can load it directly wi...
Definition: experiment_struct.h:47
#define SSTR(x)
Definition: execute_commands.h:101
#define FRAME_NUMBER_RESULT
Print the frame number in the images before save it.
Definition: define.h:36
#define EXECUTE_INFO
Value:
std::cout << std::endl \
<< " ------------------------------------------------------------------ " << std::endl \
<< " Video Stabilization." << std::endl \
<< " --> Running Armadillo version: " << arma::arma_version::as_string() << std::endl \
<< " --> Running OpenCV version: " << CV_VERSION << std::endl \
<< " --> Project webpage (database, source code and results): " << std::endl \
<< " \" www.verlab.dcc.ufmg.br/semantic_hyperlapse_project \" " << std::endl \
<< " --> If you are using it to academic purposes, please cite: " << std::endl \
<< " \" Autores. Titulo. Conferencia. Ano \" " << std::endl \
<< " --> If you need help feel free to contact us: " << std::endl \
<< " \" michel.silva66@gmail.com \" and \" washington.ramos@outlook.com \" " << std::endl \
<< " --> Institution: " << std::endl \
<< " VerLab @ Universidade Federal de Minas Gerais (UFMG), Brazil. " << std::endl \
<< " ------------------------------------------------------------------ " << std::endl \
<< std::endl;
#define EXECUTE_VIEW
Value:
if ( VIEW ) { \
imshow( "Homography", result ); \
cv::waitKey(VIEW_DELAY); \
}
#define VIEW_DELAY
Show images for each step of processing in a window called &#39;Homography&#39;.
Definition: define.h:33
#define VIEW
Show images for each step of processing in a window called &#39;Homography&#39;.
Definition: define.h:30
#define SSTR (   x)
Value:
static_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()