|

楼主 |
发表于 2025-1-16 17:38:10
|
显示全部楼层
广东省揭阳市
变量名 | 类 型 | 静态 | 数组 | 备 注 | blob | cv::Mat | | | out | cv::Mat | | | i | 整数型 | | | x | 整数型 | | | y | 整数型 | | | w | 小数型 | | | h | 小数型 | | | conf | 小数型 | | | id | 整数型 | | |
blob = Blob转换 (m_mat, 1 ÷ 255, cvSize (416, 416 ), cvScalar (0, 0, 0, 0 ), 真, 假, 5 )m_Net. 设置输入 (blob )m_Net. 前向传播 (out ) 计次循环首 (out.尺寸 [2 ], i ) conf = out. 读浮点 (1, i, 5 ) 如果真 (conf < 0.9 )  到循环尾 ()   w = out. 读浮点 (1, i, 3 )  h = out. 读浮点 (1, i, 4 ) x = (out. 读浮点 (1, i, 1 ) - w ÷ 2 ) ÷ 416 × m_mat.宽度  y = (out. 读浮点 (1, i, 2 ) - h ÷ 2 ) ÷ 416 × m_mat.高度  w = w ÷ 416 × m_mat.宽度  h = h ÷ 416 × m_mat.高度  id = 到整数 (out. 读浮点 (1, i, 6 )) 输出调试文本格式_ (“%.2f, %.2f, %.2f, %.2f, %.2f, %d”, x, y, w, h, conf, id ) 绘制矩形 (m_mat, x, y, x + w, y + h, #红色, 1 ) 计次循环尾 () 显示图像 (“name”, m_mat ) |
|