EgoVideoStabilizer  1.0.0
file_operations.h
Go to the documentation of this file.
1 //
4 // SemanticFastForward_EPIC@ECCVW is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // SemanticFastForward_JVCI is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with SemanticFastForward_EPIC@ECCVW. If not, see <http://www.gnu.org/licenses/>.
16 //
18 
26 #ifndef FILE_OPERATIONS_H
27 #define FILE_OPERATIONS_H
28 
29 #include <stdio.h>
30 #include <iostream>
31 #include <fstream>
32 #include <vector>
33 #include <cstdlib>
34 #include <string>
35 #include <algorithm> // copy
36 #include <iterator> // ostream_operator
37 #include <sstream>
38 #include <iomanip>
39 #include <limits>
40 
41 #include <boost/tokenizer.hpp>
42 #include <boost/algorithm/string.hpp>
43 
45 
56 std::vector<int> loadMasterFramesFromFile ( const EXPERIMENT& experiment_settings ) ;
57 
71 bool saveMasterFramesToFile ( const EXPERIMENT& experiment_settings , const std::vector<int> masters_frames ) ;
72 
84 void readSelectedFramesCSV (std::string filename, std::vector<int>& selected_frames) ;
85 
94 std::string getExperimentId () ;
95 
109 double getSemanticCost ( const EXPERIMENT &experiment_settings , const int frame_src , const int frame_dst ) ;
110 
119 std::vector< std::vector<double> > loadInstabilityCostsFromFile(const EXPERIMENT &experiment_settings);
120 
121 
130 std::vector< std::vector<double> > loadOpticalFlow(const EXPERIMENT &experiment_settings);
131 
140 bool str2bool(std::string str);
141 
150 std::string filter_string(std::string str);
151 
152 
153 #endif // FILE_OPERATIONS_H
Fields declaration of the experiment settings.
EXPERIMENT experiment_settings
Definition: main.cpp:59
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::vector< std::vector< double > > loadInstabilityCostsFromFile(const EXPERIMENT &experiment_settings)
loadInstabilityCostsFromFile Loads the instability costs from a CSV file (matrix format).
Definition: file_operations.cpp:259
double getSemanticCost(const EXPERIMENT &experiment_settings, const int frame_src, const int frame_dst)
Function that returns the semantic cost of the transiction from the frame_src to the frame_dst...
Definition: file_operations.cpp:209
void readSelectedFramesCSV(std::string filename, std::vector< int > &selected_frames)
Function to read a CSV composed by frames selected by the selection algorithm.
Definition: file_operations.cpp:111
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
bool saveMasterFramesToFile(const EXPERIMENT &experiment_settings, const std::vector< int > masters_frames)
Function to save the calculated master frames into a file defined in the field save_masterframes_file...
Definition: file_operations.cpp:76
std::vector< std::vector< double > > loadOpticalFlow(const EXPERIMENT &experiment_settings)
loadOpticalFlow Loads the Optical Flow calculated by the FlowNet from a CSV file. ...
Definition: file_operations.cpp:294
std::vector< int > loadMasterFramesFromFile(const EXPERIMENT &experiment_settings)
Function to load the master frames from a file defined in the field read_masterframes_filename in the...
Definition: file_operations.cpp:39