Skip to content

Instantly share code, notes, and snippets.

@maximus5684
maximus5684 / gist:082f8939edb6aed7ba0a
Created July 14, 2015 17:49
OpenCV Image Overlay w/Transparency
void OverlayImage(Mat* src, Mat* overlay, const Point& location)
{
for (int y = max(location.y, 0); y < src->rows; ++y)
{
int fY = y - location.y;
if (fY >= overlay->rows)
break;
for (int x = max(location.x, 0); x < src->cols; ++x)