V
V
Vladimir Vladimirovich2017-05-28 11:41:00
C++ / C#
Vladimir Vladimirovich, 2017-05-28 11:41:00

How to display image via OPENCV?

I have the following code:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
...
Mat img = imread("C:/Users/Пользователь/Desktop/1.png", CV_LOAD_IMAGE_COLOR);
  namedWindow("Display window", WINDOW_AUTOSIZE);// Create a window for display.
  imshow("Display window", img);

in the window just a gray background (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Gordienko, 2017-05-29
@leha2148

you need to add:
cv::waitkey(0);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question