Make intermediary Mats part of the image class.
This commit is contained in:
parent
cb3b3c98f5
commit
1f1c9e2aff
|
@ -25,6 +25,9 @@ class Image {
|
||||||
uint16_t width;
|
uint16_t width;
|
||||||
uint16_t height;
|
uint16_t height;
|
||||||
Mat blank;
|
Mat blank;
|
||||||
|
Mat loaded;
|
||||||
|
Mat resized;
|
||||||
|
Mat image;
|
||||||
public:
|
public:
|
||||||
Image();
|
Image();
|
||||||
void setDimensions(uint16_t w, uint16_t h) { width = w; height = h; };
|
void setDimensions(uint16_t w, uint16_t h) { width = w; height = h; };
|
||||||
|
|
|
@ -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) {
|
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);
|
string located_path = samples::findFile(image_path);
|
||||||
Mat loaded = imread(located_path, IMREAD_COLOR);
|
loaded = imread(located_path, IMREAD_COLOR);
|
||||||
Mat resized;
|
image = getBlank();
|
||||||
Mat image = getBlank();
|
|
||||||
|
|
||||||
if (loaded.empty()) {
|
if (loaded.empty()) {
|
||||||
cerr << "{ \"error\" : \"" << image_path << " empty\" }" << endl;
|
cerr << "{ \"error\" : \"" << image_path << " empty\" }" << endl;
|
||||||
|
|
Loading…
Reference in New Issue