added logger
This commit is contained in:
		
							parent
							
								
									069b739174
								
							
						
					
					
						commit
						7018d217f3
					
				@ -3,7 +3,7 @@ from conans import CMake, ConanFile
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class PocoTimerConan(ConanFile):
 | 
					class PocoTimerConan(ConanFile):
 | 
				
			||||||
    settings = "os", "compiler", "build_type", "arch"
 | 
					    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"
 | 
					    generators = "cmake", "gcc", "txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def imports(self):
 | 
					    def imports(self):
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										22
									
								
								src/main.cc
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								src/main.cc
									
									
									
									
									
								
							@ -1,24 +1,24 @@
 | 
				
			|||||||
#include "parseargs.hh"
 | 
					#include "parseargs.hh"
 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <iostream>
 | 
					 | 
				
			||||||
#include <opencv2/core/core.hpp>
 | 
					#include <opencv2/core/core.hpp>
 | 
				
			||||||
#include <opencv2/highgui/highgui.hpp>
 | 
					#include <opencv2/highgui/highgui.hpp>
 | 
				
			||||||
 | 
					#include <spdlog/spdlog.h>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int ac, char **av) {
 | 
					int main(int ac, char **av) {
 | 
				
			||||||
  const auto [input_file, output_file, video_output] = parse_args(ac, av);
 | 
					  const auto [input_file, output_file, video_output, iterations] =
 | 
				
			||||||
  std::cout << "Input file:\t" << input_file
 | 
					      parse_args(ac, av);
 | 
				
			||||||
            << "\nOutput file:\t" << output_file
 | 
					  spdlog::info("Input file:\t{}", input_file);
 | 
				
			||||||
            << "\nVideo output:\t" << ((video_output) ? "yes" : "no") << "\n";
 | 
					  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
 | 
					  cv::Mat image = cv::imread(input_file, cv::IMREAD_COLOR); // Read the file
 | 
				
			||||||
  if (!image.data) { // Check for invalid input
 | 
					  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;
 | 
					    return -1;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  std::cout << "Loaded image!\n";
 | 
					  spdlog::info("Image loaded!");
 | 
				
			||||||
  std::cout << "Width: " << image.size().width
 | 
					  spdlog::info("Width:\t{}", image.size().width);
 | 
				
			||||||
            << "\tHeight: " << image.size().height << '\n';
 | 
					  spdlog::info("Height:\t{}", image.size().height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user