目录
'putText' is not a member of 'cv' c++
python demo:
cv2.rectangle(frame, (x1, y1), (x2, y2), (255, 255, 0), 2)
cv2.putText(frame, f'{label} {confidence:.2f}', (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (36, 255, 12),
1)
line demo:
cv2.line(mask, (x1, y1), (x2, y2), 255, 1,cv2.LINE_AA) # 在掩模上绘制线段
'putText' is not a member of 'cv' c++
解决方法:加上头文件:
#include "opencv2/imgproc/imgproc.hpp"
(ofc, you have to link opencv_imgproc, too)
#include "opencv2/opencv.hpp"
本文解决了一个常见的OpenCV编程问题:当尝试使用'putText'函数时遇到的错误提示。通过引入必要的头文件,包括'opencv2/imgproc/imgproc.hpp'和'opencv2/opencv.hpp',可以成功地在项目中使用该函数。
3191

被折叠的 条评论
为什么被折叠?



