【问题标题】:display different window in one OpenCV在一个 OpenCV 中显示不同的窗口
【发布时间】:2015-08-01 11:49:48
【问题描述】:

对于我在 opencv 中的应用程序,我显示了三个绝缘窗口 谢谢你

【问题讨论】:

    标签: c++ opencv imshow


    【解决方案1】:

    您只能在 OpenCV 中执行此操作,即创建一个由三个图像组成的巨型 cv::Mat 并显示该矩阵,这可以像 this 一样完成:

    cv::Size s1 = img1.size();
    cv::Size s2 = img2.size();
    cv::Size s3 = img3.size();
    
    cv::Mat output(s1.height, s1.width + s2.width + s3.width, CV_MAT_TYPE); // put in the type of your mat
    
    cv::Mat help1(output, cv::Rect(0,0, s1.width, s1.height);
    cv::Mat help2(output, cv::Rect(s1.width, 0, s2.width, s2.height);
    cv::Mat help3(output, cv::Rect(s1.width + s2.width, 0, s3.width, s3.height);
    
    img1.copyTo(help1);
    img2.copyTo(help2);
    img3.copyTo(help3);
    
    cv::imshow("Output", output);
    

    【讨论】:

      【解决方案2】:

      我认为这在 OpenCV 中是不可能的: http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=show#

      您可以尝试在单个 cv::Mat 中手动复制不同的图像并将其提供给 imshow

      【讨论】:

      • 我的每张图片都有不同类型的垫子的问题
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-02
      • 1970-01-01
      • 1970-01-01
      • 2013-02-19
      • 1970-01-01
      • 2017-08-18
      • 2015-08-01
      相关资源
      最近更新 更多