增加字体大小和轮廓线的宽度

serial
Matthew 1 year ago
parent ed99ad71a5
commit bb930a7380

@ -1074,11 +1074,11 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
double width = mat.size().width;
// double ratio = std::min(height / 1024, width / 1920);
double ratio = height / 1024.0;
int thickness = round(1.2 * ratio);
int thickness = round(1.4 * ratio);
if (thickness < 1) thickness = 1;
else if (thickness > 4) thickness = 4;
else if (thickness > 5) thickness = 5;
cv::Scalar scalar(255, 255, 255); // white
int fontSize = (int)(24.0 * ratio);
int fontSize = (int)(28.0 * ratio);
cv::Point pt;
std::string fontPath;
@ -1230,6 +1230,8 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
}
#endif
textSize = ft2->getTextSize(it->text, fontSize, thickness, &baseline);
XYLOG(XYLOG_SEVERITY_DEBUG, "%s font Size=%d height: %d baseline=%d", it->text.c_str(), fontSize, textSize.height, baseline);

Loading…
Cancel
Save