背景改为半透明

hdrplus
Matthew 11 months ago
parent 8eb983d272
commit b2d74846bf

@ -1572,7 +1572,13 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
cv::Point lt(0, mat.rows - fs - 20 * ratio);
cv::Point lt2(0, lt.y - 2 * ratio);
cv::Point rb(0 + textSize.width, lt2.y + textSize.height + 8 * ratio);
cv::rectangle(mat, lt2, rb,cv::Scalar(255, 255, 255), -1);
cv::Mat roi = mat(cv::Rect(lt2, rb));
cv::Mat clrMat(roi.size(), CV_8UC3, cv::Scalar(255, 255, 255));
double alpha = 0.1;
cv::addWeighted(clrMat, alpha, roi, 1.0 - alpha , 0.0, roi);
// cv::rectangle(mat, lt2, rb,cv::Scalar(255, 255, 255), -1);
ft2->putText(mat, str, lt, fs, scalarRed, -1, cv::LINE_AA, false);
// DrawOutlineText(ft2, mat, str, cv::Point(0, mat.rows - fs - 20 * ratio), fs, scalar, 1);

Loading…
Cancel
Save