在一个窗口显示多个图像子窗口。函数showManyImages。
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
// 单窗口显示多幅图像的函数
void showMultiImages(char* title, int nArgs, ...)
{
Mat DispImage;
int size;
int ind;
int x, y;
int w, h;
int r, c;
float scale;
int max;
int space;
if(nArgs <= 0) {
printf("Number of arguments too small..../n");
return;
}
else if(nArgs > 12) {
printf("Number of arguments too large..../n");
return;
}
else if (nArgs == 1) {
r = c = 1;
size = 300;
}
else if (nArgs == 2) {
r = 2; c = 1;
size = 300;
}
else if (nArgs == 3 || nArgs == 4) {
r = 2; c = 2;
size = 300;
}
else if (nArgs =