Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you could copy the small img into the large one (aka: picture in picture), like:

Mat small, large;
cap1 >> small;
cap2 >> large;

// desired size
int w = 200;
int h = 200;
resize(small,small,Size(w,h));

// dst roi:
Rect roi(large.cols-w-1, large.cols-h-1, w, h);

small.copyTo(large(roi));
imshow("PiP", large);
waitKey(10);

you could copy the small img into the large one (aka: picture in picture), like:

Mat small, large;
cap1 >> small;
cap2 >> large;

// desired size
int w = 200;
int h = 200;
resize(small,small,Size(w,h));

// dst roi:
roi, top right:
Rect roi(large.cols-w-1, large.cols-h-1, 0, w, h);

small.copyTo(large(roi));
imshow("PiP", large);
waitKey(10);