OpenCV 相关报错

一,  undefined reference to `cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'

 

I solved this problem by change the order of target_link_libraries, like this:TARGET_LINK_LIBRARIES( test ${OpenCV_LIBS} ${catkin_LIBRARIES}OpenCV first, then catkin

 

change the order of target_link_libraries

把OpenCV lib 放在前面

target_link_libraries(homography ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} )

Python, opencv, cv2  作者:竹子熊猫

地址: https://blog.csdn.net/summermaoz/article/details/67637325

出现cv2.cv,没有cv这个属性,在命令行import cv 时出错,没有cv这个module,但是可以import cv2,解决方式是下载安装opencv。

1、两个下载模块的地址: https://pypi.python.org/pypi

2、介绍cv:  http://www.programcreek.com/python/index/413/cv

安装cv2模块:whl文件可以

安装cv模块(可以不要cv模块)
opencv版本问题,3.x不能cv2.cv, 2.x可以
例子:
           videocapture = cv2.VideoCapture(VideoFile)
安装cv:    fps = videocapture.get(cv2.cv.CV_CAP_PROP_FPS)
未安装从v:fps = videocapture.get(cv2.CAP_PROP_FPS)


3、两者区别:

cv2扩展库是针对OpenCV 2.x API创建的,直接采用NumPy的数组对象表示图像,和pyopencv相比,不再需要在数组和Mat对象之间相互转换了。

cv2的函数直接对Numpy数组进行操作,

cv2读取图像是数组,array = cv2.imread()


(1)cv读取图像:

①iplimage = cv.LoadImage()  

<type 'cv2.cv.iplimage'>

<iplimage(nChannels=3 width=1212 height=824 widthStep=3636 )>

②cvmat = cv.LoadImageM()

<type 'cv2.cv.cvmat'>

<cvmat(type=42424010 8UC3 rows=824 cols=1212 step=3636 )>


(2)array, iplimage, cvmat 转换

array------>     cvmat:        cv.fromarray(array)

cvmat------>    array:         np.asarray(cvamt)

cvmat------>    iplimage:    cv.GetImage(cvmat)  

iplimage---->   cvmat:       iplimage[:], 或 cv.GetMat(iplimage)
---------------------  
作者:竹子熊猫  
来源:CSDN  
原文:https://blog.csdn.net/summermaoz/article/details/67637325  
版权声明:本文为博主原创文章,转载请附上博文链接!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值