How can I use imshow to display multiple images in multiple windows?

后端 未结 5 1537
醉酒成梦
醉酒成梦 2021-01-02 06:40

I would like to do something like the following in order to display two images on the screen:

imshow("1", img1);
imshow(\'2\', \'img2\');

5条回答
  •  情深已故
    2021-01-02 07:23

    Yes, it is possible. The function void imshow(const string& winname, InputArray mat) displays an image in the specified window, where -

    • winname – Name of the window.
    • image – Image to be shown.

    The window is identified by its name. So to display two images(img1, img2), in two different window; use imshow with different name like :-

    imshow("1",img1);
    imshow("2",img2);
    

提交回复
热议问题