bool Overlay(cv::Mat& img, cv::Mat& ovr)
{
if (img.cols != ovr.cols || img.rows != ovr.rows)
return false;
#pragma omp parallel for // make sure to add #include <omp.h> and -fopenmp
for (int i = 0; i < img.rows; i++){
for (int j = 0; j < img.cols; j++){
cv::Vec4b bytes = ovr.at<cv::Vec4b>(i, j);
if (bytes[3] == 255){
img.at<cv::Vec3b>(i, j)[0] = ovr.at<cv::Vec4b>(i, j)[0];
img.at<cv::Vec3b>(i, j)[1] = ovr.at<cv::Vec4b>(i, j)[1];
img.at<cv::Vec3b>(i, j)[2] = ovr.at<cv::Vec4b>(i, j)[2];
}
}
}
return true;
}