X is not a member of 'cv'异常解决

举报
风吹稻花香 发表于 2021/06/05 00:52:39 2021/06/05
【摘要】 以下四种异常: 'resize' is not a member of 'cv' 'cvtColor' is not a member of 'cv' 'putText' is not a member of 'cv' 'rectangle' is not a member of 'cv' 解决方法:都是加上头文件: #inclu...

以下四种异常:

'resize' is not a member of 'cv'

'cvtColor' is not a member of 'cv'
'putText' is not a member of 'cv'

'rectangle' is not a member of 'cv'



解决方法:都是加上头文件:


#include "opencv2/imgproc/imgproc.hpp"
  

(ofc, you have to link opencv_imgproc, too)


   
  1. #include "opencv2/opencv.hpp"
  2. convertro
  3. 是opencv/core库里面的
  4. 如果报下面的错:
  5. VideoTest.cpp:(.text+0x6f): undefined reference to `cv::VideoWriter::fourcc(char,char,char, char)'
  6. VideoTest.cpp:(.text+0xc3): undefined reference to `cv::VideoWriter::open(cv::String const&, int, double, cv::Size_<int>, bool)'
  7. VideoTest.cpp:(.text+0x103): undefined reference to `cv::namedWindow(cv::String const&, int)'
  8. VideoTest.cpp:(.text+0x146): undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
  9. VideoTest.cpp:(.text+0x1b1): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
  10. 解决方法是:

    
  1. #include "opencv2/videoio.hpp"
  2. also, you don't seem to link to any of the required opencv libs, those are:
  3. opencv_core, opencv_videoio, opencv_highgui

参考网页:

http://stackoverflow.com/questions/27146818/opencv-resize-is-not-a-member-of-cv-opencv-basics

文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/jacke121/article/details/54667262

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。