Make intermediary Mats part of the image class.

This commit is contained in:
Matt McWilliams 2024-10-22 15:20:27 -04:00
parent cb3b3c98f5
commit 1f1c9e2aff
2 changed files with 5 additions and 3 deletions

View File

@ -25,6 +25,9 @@ class Image {
uint16_t width;
uint16_t height;
Mat blank;
Mat loaded;
Mat resized;
Mat image;
public:
Image();
void setDimensions(uint16_t w, uint16_t h) { width = w; height = h; };

View File

@ -13,9 +13,8 @@ Mat Image::getBlank () {
Mat Image::loadImage (string& image_path, uint64_t& x, uint64_t& y, uint64_t& w, uint64_t& h) {
string located_path = samples::findFile(image_path);
Mat loaded = imread(located_path, IMREAD_COLOR);
Mat resized;
Mat image = getBlank();
loaded = imread(located_path, IMREAD_COLOR);
image = getBlank();
if (loaded.empty()) {
cerr << "{ \"error\" : \"" << image_path << " empty\" }" << endl;