Ask Your Question

Revision history [back]

Hi there,

Let me illustrate this with an example: lets say that you have a small image and you want to insert it at the point (x,y) of your "big image": you can do something like this:

cv::Mat small_image;
cv::Mat big_image;
...
//Somehow fill small_image and big_image with your data
...
small_image.copyTo(big_image(x,y,small_image.cols, small_image.rows));

With this what you are doing is to create a ROI (region of interest) on your big image located at point (x,y) and of the same size as small_image. Then you copy the small_image into that ROI.

Hi there,

Let me illustrate this with an example: lets say that you have a small image and you want to insert it at the point (x,y) of your "big image": you can do something like this:

cv::Mat small_image;
cv::Mat big_image;
...
//Somehow fill small_image and big_image with your data
...
small_image.copyTo(big_image(x,y,small_image.cols, small_image.rows));
small_image.copyTo(big_image(cv::Rect(x,y,small_image.cols, small_image.rows)));

With this what you are doing is to create a ROI (region of interest) on your big image located at point (x,y) and of the same size as small_image. Then you copy the small_image into that ROI.