genetic-images/src/main.cc

25 lines
770 B
C++

#include "parseargs.hh"
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#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";
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";
return -1;
}
std::cout << "Loaded image!\n";
std::cout << "Width: " << image.size().width
<< "\tHeight: " << image.size().height << '\n';
return 0;
}