35 #include <opencv2/core/core.hpp> 47 std::string video_path;
48 std::string output_path;
49 std::string video_name;
50 std::string original_video_filename;
51 std::string read_masterframes_filename;
52 std::string selected_frames_filename;
53 std::string semantic_costs_filename;
54 std::string instability_costs_filename;
55 std::string optical_flow_filename;
57 bool saveMasterFramesInDisk =
false;
58 bool saveVideoInDisk =
false;
59 bool runningParallel =
true;
61 cv::FileStorage fs(settingsFilename, cv::FileStorage::READ);
70 original_video_filename =
filter_string(fs[
"original_video_filename"]);
71 selected_frames_filename =
filter_string(fs[
"selected_frames_filename"]);
72 read_masterframes_filename =
filter_string(fs[
"read_masterframes_filename"]);
73 semantic_costs_filename =
filter_string(fs[
"semantic_costs_filename"]);
75 segmentSize = fs[
"segmentSize"];
77 runningParallel =
str2bool(fs[
"runningParallel"]);
78 saveMasterFramesInDisk =
str2bool(fs[
"saveMasterFramesInDisk"]);
79 saveVideoInDisk =
str2bool(fs[
"saveVideoInDisk"]);
82 char hostname[HOST_NAME_MAX];
83 gethostname(hostname, HOST_NAME_MAX);
86 experiment_settings.
video_filename = video_path +
"/" + video_name;
87 experiment_settings.
output_path =
SSTR ( output_path <<
"/" << video_name.substr(0,video_name.find_last_of(
'.')) <<
"_N" << segmentSize <<
"_" 88 << hostname <<
"_ExpID_" << experiment_settings.
id);
90 << segmentSize <<
"_" << hostname <<
"_ExpID_" << experiment_settings.
id <<
".avi" );
92 << video_name.substr(0,video_name.find_last_of(
'.')) <<
".csv");
93 experiment_settings.
log_file_name =
SSTR ( experiment_settings.
output_path <<
"/Log_" << video_name.substr(0,video_name.find_last_of(
'.')) <<
"_N" 94 << segmentSize <<
"_" << hostname <<
"_ExpID_" << experiment_settings.
id <<
".txt" ) ;
109 #endif // EXPERIMENTS_H std::string original_video_filename
Complete path to the folder where the results will be saved.
Definition: experiment_struct.h:36
int segment_size
Complete path and filename to save the txt file log execution.
Definition: experiment_struct.h:45
std::string video_filename
Definition: experiment_struct.h:34
bool running_parallel
Save stabilized video in Disk.
Definition: experiment_struct.h:48
std::string semantic_costs_filename
Complete path and filename of the csv file with the selected master frames that was selected to creat...
Definition: experiment_struct.h:41
std::string read_master_frames_filename
Complete path and filename of the original video.
Definition: experiment_struct.h:37
Fields declaration of the experiment settings.
EXPERIMENT load_experiments_settings(std::string settingsFilename)
Definition: experiments.h:43
Header functions for the file_operations.cpp.
EXPERIMENT experiment_settings
Definition: main.cpp:59
std::string save_video_filename
Complete path and filename to save the txt file with the selected master frames.
Definition: experiment_struct.h:39
std::string optical_flow_filename
Complete path and filename of the csv file with the jitter costs of the transitions.
Definition: experiment_struct.h:43
std::string instability_costs_filename
Complete path and filename of the csv file with the semantic costs of the frame transitions.
Definition: experiment_struct.h:42
std::string filter_string(std::string str)
filter_string filter a string to remove white spaces and line break.
Definition: file_operations.cpp:352
std::string id
Definition: experiment_struct.h:33
std::string selected_frames_filename
Complete path and filename of the save the stabilized video.
Definition: experiment_struct.h:40
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
std::string log_file_name
Complete path and filename of the csv file with the optical flow calculated by the FlowNet...
Definition: experiment_struct.h:44
bool save_master_frames_in_disk
Size of the segments where the master frames will be calculated.
Definition: experiment_struct.h:46
Definition: experiment_struct.h:32
std::string getExperimentId()
Function that manages the experiments ID automatically.
Definition: file_operations.cpp:141
bool str2bool(std::string str)
str2bool convert a string to boolean.
Definition: file_operations.cpp:334
Macro with specific codes.
std::string output_path
Complete path and filename of the video with extension.
Definition: experiment_struct.h:35
#define SSTR(x)
Definition: execute_commands.h:101
std::string save_master_frames_filename
Complete path and filename of the txt file with the selected master frames.
Definition: experiment_struct.h:38