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 height;
|
||||
Mat blank;
|
||||
Mat loaded;
|
||||
Mat resized;
|
||||
Mat image;
|
||||
public:
|
||||
Image();
|
||||
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) {
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue