aihot  2017-05-02 12:44:48  OpenCV |   查看评论   

 OpenCV学习笔记(五十七)——在同一窗口显示多幅图片

好久没更新blog里,看到OpenCV官网做的越来越好,心里也是很高兴的,真有些冲动将来加入到这个组织里做些事。估计2.4.3要在国庆左右跟大家见面,让我们多期待一下吧。

闲话少说,今天不介绍复杂的算法了,来个简单的,大家写文章做图经常用Matlab,在Matlab里经常在一个窗口里打开多幅图片。遗憾的是OpenCV没有集成这样的功能,但这难不倒大家,让我试试用ROI来解决这个问题。

没啥好讲的,上好了:

  1. void imshowMany(const std::string& _winName, const vector<Mat>& _imgs)  
  2. {  
  3.     int nImg = (int)_imgs.size();  
  4.       
  5.     Mat dispImg;  
  6.   
  7.     int size;  
  8.     int x, y;  
  9.   
  10.     // w - 一行中最大图像数 
  11.     // h - 列中最大图像数  
  12.     int w, h;  
  13.     // 规模 - 我们需要调整图像的大小 
  14.     float scale;  
  15.     int max;  
  16.   
  17.     if (nImg <= 0)   
  18.     {  
  19.         printf("Number of arguments too small....\n");  
  20.         return;  
  21.     }  
  22.     else if (nImg > 12)  
  23.     {  
  24.         printf("Number of arguments too large....\n");  
  25.         return;  
  26.     }  
  27.       
  28.     else if (nImg == 1)  
  29.     {  
  30.         w = h = 1;  
 

除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自OpenCV学习笔记(五十七)——在同一窗口显示多幅图片

留言与评论(共有 0 条评论)
   
验证码:
[lianlun]1[/lianlun]