Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

imshow() shows the image after scanf_s()

$
0
0
Hello, I would like to get some user input after I show an image. But even though imshow() is being executed, it waits till the user input to show the image. I get an empty window until scanf_s() is done. Why is this happening? I am using Visual Studio 2013, and OpenCV 2.4.11. Here is a little demo: #include #include #include using namespace cv; using namespace std; int main() { char in[15]; namedWindow("Source", 1); Mat src = imread("toy.png"); imshow("Source", src); scanf_s("%s", in, sizeof in); waitKey(); return 0; } toy.png: ![toy](/upfiles/14448200523682063.png)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>