Skip to content

Instantly share code, notes, and snippets.

@grefab
Created July 29, 2016 14:30
Show Gist options
  • Save grefab/96532167351dd1f882423845cb83b726 to your computer and use it in GitHub Desktop.
Save grefab/96532167351dd1f882423845cb83b726 to your computer and use it in GitHub Desktop.
#include "3rdparty/benchmark/include/benchmark/benchmark.h"
#include "src/cvlab/video_processing_engine.h"
#include "src/cvlab/tools/weighted_moving_average.h"
cv::Mat frame = cv_tools::cv_mat_from_file("frame.cvmat");
weighted_moving_average::storage frames_wma(frame.size(), "sum_frames");
cv::Mat localize_in = cv_tools::as_gray_mat(calculate_average_mat(frames_wma));
const int border_fraction = 8;
int h_border = frame.cols / border_fraction;
int v_border = frame.rows / border_fraction;
static void BM_align_frame(benchmark::State& state) {
while (state.KeepRunning()) {
get_aligned_mat(frame, localize_in, h_border, v_border);
}
}
BENCHMARK(BM_align_frame)->Unit(benchmark::kMillisecond);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment