gpt4 book ai didi

c++ - 错误 : putText is not a member of CV?

转载 作者:太空狗 更新时间:2023-10-29 23:49:47 26 4
gpt4 key购买 nike

我无法使用函数 putText。我收到编译错误“putText 不是 CV 的成员”或“putText 未在此范围内声明”。这些是我包括的库:

#include <iostream>
#include "core.hpp"
#include "highgui.hpp"
#include "imgcodecs.hpp"
#include "cv.h"

我就是这样调用它的:

cv::putText(frame,"REC",Point(0,60),2,2,Scalar(0,0,255));

我做错了什么?

最佳答案

putText 已移至 OpenCV 3 中的 imgproc 模块(之前它位于 core 模块中)。

所以你需要:

#include "imgproc.hpp"

您可以包含 opencv.hpp 以避免此类问题,因为它将包含您的所有 header 。

关于c++ - 错误 : putText is not a member of CV?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36989044/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com