Skip to content

Instantly share code, notes, and snippets.

@alfredplpl
Last active December 25, 2015 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredplpl/7007944 to your computer and use it in GitHub Desktop.
Save alfredplpl/7007944 to your computer and use it in GitHub Desktop.
cv::Mat image=cv::imread("./image.png",-1);
cv::Mat trans=cv::imread("./trans.png",0);
cv::Rect rect1(startColumn1,startRow1,trans.cols,trans.rows);
cv::Mat subdst1=dst(rect1);
trans.convertTo(subdst1,subdst1.type(),alpha);//double alphaは透過率[0.0, 1.0]
cv::Rect rect2(startColumn2,startRow2,image.cols,image.rows);
cv::Mat subdst2=dst(rect2);
image.copyTo(subdst2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment