好久没更新blog里,看到OpenCV官网做的越来越好,心里也是很高兴的,真有些冲动将来加入到这个组织里做些事。估计2.4.3要在国庆左右跟大家见面,让我们多期待一下吧。
闲话少说,今天不介绍复杂的算法了,来个简单的,大家写文章做图经常用Matlab,在Matlab里经常在一个窗口里打开多幅图片。遗憾的是OpenCV没有集成这样的功能,但这难不倒大家,让我试试用ROI来解决这个问题。
没啥好讲的,上好了:
- void imshowMany(const std::string& _winName, const vector<Mat>& _imgs)
- {
- int nImg = (int)_imgs.size();
- Mat dispImg;
- int size;
- int x, y;
- // w - 一行中最大图像数
- // h - 列中最大图像数
- int w, h;
- // 规模 - 我们需要调整图像的大小
- float scale;
- int max;
- if (nImg <= 0)
- {
- printf("Number of arguments too small....\n");
- return;
- }
- else if (nImg > 12)
- {
- printf("Number of arguments too large....\n");
- return;
- }
- else if (nImg == 1)
- {
- w = h = 1;