|
|
|
@ -939,7 +939,7 @@ void DrawOutlineText(cv::Ptr<cv::ft::FreeType2> ft2, cv::Mat& mat, const std::st
|
|
|
|
|
for (std::vector<std::string>::const_iterator it = lines.cbegin(); it != lines.cend(); ++it )
|
|
|
|
|
{
|
|
|
|
|
textSize = ft2->getTextSize(*it, fontSize, thickness, &baseline);
|
|
|
|
|
lineHeight = std::max(fontSize, textSize.height);
|
|
|
|
|
lineHeight = std::max(fontSize, textSize.height + baseline);
|
|
|
|
|
|
|
|
|
|
ft2->putText(mat, *it, pt, fontSize, clr, thickness, cv::LINE_AA, false, true);
|
|
|
|
|
|
|
|
|
@ -952,7 +952,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
|
|
|
|
|
{
|
|
|
|
|
if (mCamera == NULL)
|
|
|
|
|
{
|
|
|
|
|
int aa = 0;
|
|
|
|
|
// int aa = 0;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1060,7 +1060,6 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
|
|
|
|
|
captureResult.hdrMode);
|
|
|
|
|
// cv::putText(mat, str, cv::Point(0, mat.rows - 20), cv::FONT_HERSHEY_COMPLEX, fontScale, scalar, thickness1, cv::LINE_AA);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textSize = ft2->getTextSize(str, fontSize, -1, &baseline);
|
|
|
|
|
ft2->putText(mat, str, cv::Point(0, mat.rows - fontSize - 20 * ratio),
|
|
|
|
|
fontSize, scalarRed, -1, cv::LINE_AA, false);
|
|
|
|
@ -1105,12 +1104,12 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
|
|
|
|
|
else if (it->alignment == OSD_ALIGNMENT_BOTTOM_RIGHT)
|
|
|
|
|
{
|
|
|
|
|
pt.x = width - textSize.width - it->x * ratio;
|
|
|
|
|
pt.y = height - it->y * ratio - textSize.height;
|
|
|
|
|
pt.y = height - it->y * ratio - textSize.height - baseline;
|
|
|
|
|
}
|
|
|
|
|
else if (it->alignment == OSD_ALIGNMENT_BOTTOM_LEFT)
|
|
|
|
|
{
|
|
|
|
|
pt.x = it->x * ratio;
|
|
|
|
|
pt.y = height - it->y * ratio - textSize.height;
|
|
|
|
|
pt.y = height - it->y * ratio - textSize.height - baseline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// cv::Rect rc(pt.x, pt.y, textSize.width, textSize.height);
|
|
|
|
|