1 | initial version |
May be something like this :
Mat paste(frame_height, frame_width,CV_8UC3);
Rect r(0,0,0,0);
for (int i = 0,k=0; i < 10; i++)
{
for (int j = 0; j < 10; j++,k++)
{
r.width = divided[i].cols;
r.height = divided[i].rows;
divided[k].copyTo(paste(r));
r.y+= r.height;
}
r.y=0;
r.x+= r.width;
}
imshow("paste",paste);
waitKey(0);
2 | No.2 Revision |
May be something like this :for you puzzle (it is not really image processing but it is funny):
Mat paste(frame_height, frame_width,CV_8UC3);
Rect r(0,0,0,0);
vector<int> pos(100);
for (int i=0;i<100;i++)
pos[i]=i;
RNG rg;
for (int i = 0; i < 1000; i++)
{
int k=rg.uniform(0,100);
swap(pos[0],pos[k]);
}
for (int i = 0,k=0; i < 10; i++)
{
for (int j = 0; j < 10; j++,k++)
{
r.width = divided[i].cols;
r.height = divided[i].rows;
divided[k].copyTo(paste(r));
divided[pos[k]].copyTo(paste(r));
r.y+= r.height;
}
r.y=0;
r.x+= r.width;
}
imshow("paste",paste);
waitKey(0);