added logger

This commit is contained in:
Phuntsok Drak-pa 2019-03-19 14:22:59 +01:00
parent 069b739174
commit 7018d217f3
2 changed files with 12 additions and 12 deletions

View File

@ -3,7 +3,7 @@ from conans import CMake, ConanFile
class PocoTimerConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "opencv/4.0.1@conan/stable", "boost/1.69.0@conan/stable"
requires = "opencv/4.0.1@conan/stable", "boost/1.69.0@conan/stable", "spdlog/1.3.1@bincrafters/stable"
generators = "cmake", "gcc", "txt"
def imports(self):

View File

@ -1,24 +1,24 @@
#include "parseargs.hh"
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <spdlog/spdlog.h>
#include <string>
int main(int ac, char **av) {
const auto [input_file, output_file, video_output] = parse_args(ac, av);
std::cout << "Input file:\t" << input_file
<< "\nOutput file:\t" << output_file
<< "\nVideo output:\t" << ((video_output) ? "yes" : "no") << "\n";
const auto [input_file, output_file, video_output, iterations] =
parse_args(ac, av);
spdlog::info("Input file:\t{}", input_file);
spdlog::info("Output file:\t{}", output_file);
spdlog::info("Video output:\t{}", video_output);
spdlog::info("Iterations:\t{}", iterations);
cv::Mat image = cv::imread(input_file, cv::IMREAD_COLOR); // Read the file
if (!image.data) { // Check for invalid input
std::cout << "Could not open or find the image\n";
spdlog::critical("Could not open or find image!\n");
return -1;
}
std::cout << "Loaded image!\n";
std::cout << "Width: " << image.size().width
<< "\tHeight: " << image.size().height << '\n';
spdlog::info("Image loaded!");
spdlog::info("Width:\t{}", image.size().width);
spdlog::info("Height:\t{}", image.size().height);
return 0;
}