C++ Place an image on top of another image in a certain location -


i'm looking way place on image on top of image @ set location.

i have been able place images on top of each other using cv::addweighted when searched particular problem, there wasn't posts find relating c++.

quick example:

200x200 red square & 100x100 blue square

enter image description here & enter image description here

blue square on red square @ 70x70 (from top left corner pixel of blue square)

enter image description here

you can create mat points rectangular region of original image , copy blue image that:

mat bigimage = imread("redsquare.png", -1); mat lilimage = imread("bluesquare.png", -1);  mat insetimage(bigimage, rect(70, 70, 100, 100)); lilimage.copyto(insetimage);  imshow("overlay image", bigimage); 

Comments

Popular posts from this blog

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -