genetic-images/src/main.cc

25 lines
770 B
C++
Raw Normal View History

2019-03-19 12:49:37 +00:00
#include "parseargs.hh"
2019-03-19 09:14:19 +00:00
#include <iostream>
2019-03-19 10:15:42 +00:00
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
2019-03-19 12:49:37 +00:00
#include <string>
2019-03-19 10:15:42 +00:00
2019-03-19 12:49:37 +00:00
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";
2019-03-19 10:15:42 +00:00
2019-03-19 12:49:37 +00:00
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";
2019-03-19 10:15:42 +00:00
return -1;
}
2019-03-19 12:49:37 +00:00
std::cout << "Loaded image!\n";
std::cout << "Width: " << image.size().width
<< "\tHeight: " << image.size().height << '\n';
2019-03-19 10:15:42 +00:00
2019-03-19 09:14:19 +00:00
return 0;
}