1 | initial version |
Something like this works
Mat m = imread("f:/lib/opencv/samples/data/lena.jpg", CV_LOAD_IMAGE_COLOR);
Mat logoOriginal = imread("f:/lib/opencv/samples/data/LinuxLogo.jpg",CV_LOAD_IMAGE_COLOR);
resize(logoOriginal,logoOriginal,Size(),0.5,0.5);
imshow("Lena",m);
imshow("Logo",logoOriginal);
waitKey();
Rect r(256-logoOriginal.cols/2,256-logoOriginal.rows/2,logoOriginal.cols,logoOriginal.rows);
logoOriginal.copyTo(m(r));
imshow("Lena+logo",m);
waitKey();
Image depth must be same
2 | No.2 Revision |
Something like this works
Mat m = imread("f:/lib/opencv/samples/data/lena.jpg", CV_LOAD_IMAGE_COLOR);
Mat logoOriginal = imread("f:/lib/opencv/samples/data/LinuxLogo.jpg",CV_LOAD_IMAGE_COLOR);
resize(logoOriginal,logoOriginal,Size(),0.5,0.5);
imshow("Lena",m);
imshow("Logo",logoOriginal);
waitKey();
Rect r(256-logoOriginal.cols/2,256-logoOriginal.rows/2,logoOriginal.cols,logoOriginal.rows);
logoOriginal.copyTo(m(r));
imshow("Lena+logo",m);
waitKey();
Image depth must be same same.
PS There is tutorial somewhere and many post about this