Trdrop - System Presentation
Alexander Isenko
A video analysis software
1
Trdrop - System Presentation
Alexander Isenko
2
Trdrop - System Presentation
Alexander Isenko
3
Trdrop - System Presentation
Alexander Isenko
4
Trdrop - System Presentation
Alexander Isenko
5
Trdrop - System Presentation
Alexander Isenko
6
Trdrop - System Presentation
Alexander Isenko
7
int main(int argc, char** argv){
Config config(-1, argc, argv);
TaskScheduler scheduler(config.inputs);
FPSPreTask fpsPreT("FPS",
config.inputs.size(),
config.pixelDifference);
scheduler.addPreTask(std::make_shared<FPSPreTask>(fpsPreT));
std::vector<double> framerates;
while (scheduler.next()) {
if (fpsPreT.result.successful()) {
framerates = fpsPreT.result.getSuccess();
}
}
}
Trdrop - System Presentation
Alexander Isenko
8
std::vector<tostring> convertions;
LoggerTask<CSVFormatter> loggerT(
convertions,
{ "Frameindex", " " + fpsPreT.id },
config.inputNames,
config.logName
);
convertions.push_back([&](int ix){
return trdrop::util::string_format(
"%10i", scheduler.getCurrentFrameIndex());
});
convertions.push_back([&](int ix){
return trdrop::util::string_format(
"%6." + std::to_string(config.fpsPrecision) + "f", framerates[ix]);
});
// class LoggerTask
public:
void process(cv::Mat & res, const size_t currentFrame, const size_t vix) {
std::vector<std::string> values;
std::transform(conversions.begin(),
conversions.end(),
std::back_inserter(values),
[&](tostring f) { return f(vix); });
(*streams[vix]) << formatter.format(values.begin(), values.end());
});
}
Trdrop - System Presentation
Alexander Isenko
9