diff --git a/src/image.cpp b/src/image.cpp index 4787b85..e005345 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -14,19 +14,19 @@ 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(); if (loaded.empty()) { cerr << "Image " << loaded << " empty" << endl; } else { cout << "Loaded image " << image_path << endl; - //cout << " dim " << loaded.cols << "x" << loaded.rows << endl; - - resize(loaded, loaded, Size(h, w)); + cout << " dim " << loaded.cols << "x" << loaded.rows << endl; + cout << "target " << w << "x" << h << endl; + resize(loaded, resized, Size(h, w)); //cout << " image " << image.cols << "x" << image.rows << endl; //cout << "resized " << resized.cols << "x" << resized.rows << endl; - //resized.copyTo(image(Rect(0, 0, resized.cols, resized.rows))); - loaded.copyTo(image(Rect(x, y, loaded.cols, loaded.rows))); + resized.copyTo(image(Rect(x, y, resized.cols, resized.rows))); flip(image, image, 0); #if (CV_VERSION_MAJOR >= 4) diff --git a/src/main.cpp b/src/main.cpp index a5f5f20..b84949a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -103,7 +103,7 @@ void actionLoad () { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexSubImage2D(GL_TEXTURE_2D, // Type of texture + glTexImage2D(GL_TEXTURE_2D, // Type of texture 0, // Pyramid level (for mip-mapping) - 0 is the top level GL_RGB, // Internal colour format to convert to image.cols, // Image width @@ -158,7 +158,7 @@ void display () { auto currentTime = steady_clock::now(); auto elapsedTime = duration_cast(currentTime - startTime).count(); if (elapsedTime > exposureTime) { - cout << "Exposure = " << elapsedTime << " ms" << endl; + cout << "Exposed = " << elapsedTime << " ms" << endl; displaying = false; completed = true; }