修复结果图显示

This commit is contained in:
2024-06-05 01:32:54 +08:00
parent 5e6b7b94cf
commit 3529db0321
17 changed files with 11 additions and 8 deletions
@@ -202,7 +202,7 @@ cv::Mat pinHandleAiEvaluate(std::shared_ptr <detData> data, cv::Mat& src,
if (src.channels() == 3)
src.copyTo(Paint);
else
cvtColor(src, Paint, COLOR_GRAY2BGR);
cvtColor(src, Paint, cv::COLOR_GRAY2BGR);
//处理
auto start = std::chrono::high_resolution_clock::now();
cv::Mat segRes = ~segPtr->Evaluate(src);
@@ -123,18 +123,21 @@ void threadManager::resultHandle(std::shared_ptr <detData> data)
{
//总图像大小 平铺显示
int matWidth = 0, matHeight = 0;
for (auto mat : data->resultImgs)
for (auto& mat : data->resultImgs)
{
matHeight = max(mat.cols, matHeight);
matWidth += mat.rows;
matHeight = max(mat.rows, matHeight);
matWidth += mat.cols;
}
cv::Mat showMat(matWidth, matHeight, CV_8UC3);
cv::Mat showMat(matHeight, matWidth, CV_8UC3);
//平铺图像
int withCnt = 0;
for (auto mat : data->resultImgs)
//cv::Mat ab = showMat(cv::Rect(withCnt, 0, data->resultImgs[0].rows, data->resultImgs[0].cols)).clone();
for (auto& resultMat : data->resultImgs)
{
mat.copyTo(showMat(cv::Rect(withCnt, 0, mat.cols, mat.rows)));
resultMat.copyTo(showMat(cv::Rect(withCnt, 0, resultMat.cols, resultMat.rows)));
withCnt += resultMat.cols;
}
std::cout << withCnt;
//打包发送
QPixmap pixmap;
cvMatToQPixMap(showMat, pixmap);
+1 -1
View File
@@ -17,7 +17,7 @@
#define sColor_Black "22, 22, 22"
#define sColor_BlackWithWhite "45, 45, 45"
#define enableHandleAiModel 0
#define enableHandleAiModel 1
#define disableBackEndCheck 1
//窗口设置
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.