Resize the image before placing within the blank image.
This commit is contained in:
parent
cc045fe775
commit
a2b69433e2
|
@ -13,14 +13,14 @@ Mat Image::loadImage (string& image_path, uint64_t& x, uint64_t& y, uint64_t& w,
|
||||||
Mat loaded = imread(located_path, IMREAD_COLOR);
|
Mat loaded = imread(located_path, IMREAD_COLOR);
|
||||||
Mat image = getBlank();
|
Mat image = getBlank();
|
||||||
|
|
||||||
if (image.empty()) {
|
if (loaded.empty()) {
|
||||||
cerr << "Image " << image << " empty" << endl;
|
cerr << "Image " << loaded << " empty" << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << "loaded " << image_path << endl;
|
cout << "Loaded image " << image_path << endl;
|
||||||
cout << " dim " << loaded.cols << "x" << loaded.rows << endl;
|
//cout << " dim " << loaded.cols << "x" << loaded.rows << endl;
|
||||||
|
|
||||||
//resize(loaded, resized, Size(1280, 1080));
|
resize(loaded, loaded, Size(h, w));
|
||||||
cout << " image " << image.cols << "x" << image.rows << endl;
|
//cout << " image " << image.cols << "x" << image.rows << endl;
|
||||||
//cout << "resized " << resized.cols << "x" << resized.rows << endl;
|
//cout << "resized " << resized.cols << "x" << resized.rows << endl;
|
||||||
//resized.copyTo(image(Rect(0, 0, resized.cols, resized.rows)));
|
//resized.copyTo(image(Rect(0, 0, resized.cols, resized.rows)));
|
||||||
loaded.copyTo(image(Rect(x, y, loaded.cols, loaded.rows)));
|
loaded.copyTo(image(Rect(x, y, loaded.cols, loaded.rows)));
|
||||||
|
|
Loading…
Reference in New Issue