#include #include #include "opencv2/opencv.hpp" #include "opencv2/photo/photo.hpp" #include "cxxopts/src/cxxopts.hpp" using namespace std; using namespace cv; int main (int argc, char** argv) { cxxopts::Options opt(argv[0], " - Options"); opt.add_options() ("f,file", "file", cxxopts::value()) ("s,sigma", "sigma for Gaussian Blur", cxxopts::value()->default_value("3.0")) ("a,alpha", "weight of the first array elements", cxxopts::value()->default_value("1.5")) ("b,beta", "weight of the second array elements", cxxopts::value()->default_value("-0.5")) ("g,gamma", "scalar added to each sum", cxxopts::value()->default_value("0")) ("o,output", "output file", cxxopts::value()); opt.parse(argc, argv); auto& file = opt["f"].as(); auto& output = opt["o"].as(); float sigma = opt["s"].as(); float alpha = opt["a"].as(); float beta = opt["b"].as(); Mat src = imread(file, 1), dst; cv::GaussianBlur(src, dst, cv::Size(0, 0), sigma); cv::addWeighted(src, alpha, dst, beta, 0, dst); imwrite(output, dst); return 0; }