added logger
This commit is contained in:
parent
069b739174
commit
7018d217f3
@ -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):
|
||||
|
22
src/main.cc
22
src/main.cc
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user