Show multiple (2,3,4,…) images in the same window in OpenCV

后端 未结 6 1859
臣服心动
臣服心动 2020-12-13 07:11

I want to show 2, 3 or more images in the same window.

My problem is how to put the second, third image just on the right side (above, left or upper) the main image.

6条回答
  •  不知归路
    2020-12-13 07:57

    Or just use:

    Mat a, Mat b, Mat dst // a,b loaded
    
    cv::hconcat(a, b, dst) // horizontal
    cv::vconcat(a, b, dst) // vertical
    

    Mat dst -> | a | b |

    or do it with vector:

    std::vector matrices = {
                a, b
        };
    hconcat(matrices, dst);
    

提交回复
热议问题