1 | initial version |
imshow() only sets a pointer to the image, the real drawing happens in waitKey()
(the windows internal event-loop is triggered from there)
so, it's just a matter of order:
Mat src = imread("toy.png");
imshow("Source", src);
waitKey(1); // wait only a very short time
scanf_s("%s", in, sizeof in); // get your input
// some more processing ...
waitKey(); // wait forever now (don't let the prog close the window)
2 | No.2 Revision |
imshow() only sets a pointer to the image, the real drawing happens in waitKey()
(the windows window's internal event-loop is triggered from there)
so, it's just a matter of order:
Mat src = imread("toy.png");
imshow("Source", src);
waitKey(1); // wait only a very short time
scanf_s("%s", in, sizeof in); // get your input
// some more processing ...
waitKey(); // wait forever now (don't let the prog close the window)