Win8+VS2013编译opencv

原本在win7+VS2010环境下已经用CMake成功编译了opencv243

换在Win8+VS2013环境下会报几个错误。


解决方法如该链接:

https://github.com/Itseez/opencv/commit/52a904e17b28b59ab149f3eb57ff030468bcf1ef


1,找不到min和max的定义

解决方法:在该文件内添加#include <algorithm>


2,错误 3 error C1075: 与左侧的 大括号“{”(位于“D:\opencv_2.4.3\opencv\modules\features2d\src\features2d_init.cpp(167)”)匹配之前遇到文件结束D:\opencv_2.4.3\opencv\modules\core\include\opencv2\core\core.hpp4470 1 opencv_features2d


解决方法:features2d_init.cpp文件中,把obj.info()->addParam(obj, "detector", obj.detector);这一行改成obj.info()->addParam<FeatureDetector>(obj, "detector", obj.detector, false, 0, 0, "Detector algorithm.");

原链接最后一个改动我没做,但是debug编译成功了。

然而,release版编译不成功,错误出在orb.obj,所以还是要修改orb.cpp

去掉

    #define GET_VALUE(idx) \
        center[cvRound(pattern[idx].x*b + pattern[idx].y*a)*step + \
               cvRound(pattern[idx].x*a - pattern[idx].y*b)]
这三行

添加
float x, y;
int ix, iy;
#define GET_VALUE(idx) \
       (x = pattern[idx].x*a - pattern[idx].y*b, \
        y = pattern[idx].x*b + pattern[idx].y*a, \
        ix = cvRound(x), \
        iy = cvRound(y), \
        *(center + iy*step + ix) )


去掉

void ORB::detectImpl( const Mat& image, vector<KeyPoint>& keypoints, const Mat& mask) const

改为
void ORB::detectImpl(const Mat& image, std::vector<KeyPoint>& keypoints, const Mat& mask) const


完成


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值