opencv_contrib 配置中常见问题的解决
来源:互联网 发布:电脑管家for mac 编辑:程序博客网 时间:2024/05/22 19:53
在opencv3.0中,如果需要SIFT,SURF等算法的时候,需要配置opencv_contrib .
罗列一下自己在配置的过程中遇到的问题:
1.
CMake Error at D:/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download): Unknown CMake command "ocv_download".Call Stack (most recent call first): D:/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:51 (ocv_protobuf_download) D:/opencv_contrib-3.2.0/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:30 (include) D:/opencv_contrib-3.2.0/modules/dnn/CMakeLists.txt:35 (include)
解决方案:可能使用的是opencv_contrib-3.2.0版本,网上有好多的教程,下载protobuf-cpp-3.1.0.tar.gz等,但是可能由于本人的技术有限,使用这种方法等不到解决。
所以使用的第二种方法,下载opencv_contrib-3.0.0版本,顺利通过配置。
2. error LNK2026 模块对于 SAFESEH 映像是不安全的
解决方案:属性->链接器->高级->Image Has Safe Exception Handler:NO:/SAFESEH
问题得到解决
测试代码
#include <iostream>#include <opencv2/opencv.hpp> #include <opencv2/xfeatures2d.hpp>using namespace cv; using namespace std;int main(){//Create SIFT class pointerPtr<Feature2D> f2d = xfeatures2d::SIFT::create();//读入图片Mat img_1 = imread("1.tif");Mat img_2 = imread("2.tif");//Detect the keypointsvector<KeyPoint> keypoints_1, keypoints_2;f2d->detect(img_1, keypoints_1);f2d->detect(img_2, keypoints_2);//Calculate descriptors (feature vectors)Mat descriptors_1, descriptors_2;f2d->compute(img_1, keypoints_1, descriptors_1);f2d->compute(img_2, keypoints_2, descriptors_2);//Matching descriptor vector using BFMatcherBFMatcher matcher;vector<DMatch> matches;matcher.match(descriptors_1, descriptors_2, matches);Mat img_matches;drawMatches(img_1, keypoints_1, img_2, keypoints_2, matches, img_matches);imshow("match", img_matches);waitKey(0);}
2 0
- opencv_contrib 配置中常见问题的解决
- OpenCV_contrib配置
- Tomcat的配置及常见问题解决
- Python中常见问题的解决汇总
- OGRE中常见问题解决
- 如何正确的下载和配置opencv和opencv_contrib
- opencv 以及opencv_contrib ubuntu14.04 配置的问题汇总
- wamp2.5的配置以及一些常见问题的解决
- Android 开发配置常见问题解决
- AndroidStudio配置常见问题及解决
- eclipse for java ee的tomcat配置(常见问题解决)
- eclipse for java ee的tomcat配置(常见问题解决)
- eclipse for java ee的tomcat配置(常见问题解决)
- Windows下的PHP开发环境配置及常见问题解决
- Hadoop学习-hive的安装配置与常见问题解决
- 移动硬盘常见问题的解决
- 移动硬盘常见问题的解决
- 移动硬盘常见问题的解决
- 多态
- mysql主从同步
- 如何更好的进行单元测试——JUnit
- 2017蓝桥杯模拟赛 字符串比较
- centos7.1安装 python2.7.10
- opencv_contrib 配置中常见问题的解决
- poj 3683 2-sat
- 【JZOJ100003】【NOI2017模拟.4.1】 Tree
- (转)贝莱德,从零到五万亿
- poj 2728 Desert King(最优比率生成树)
- Java接口
- Unity3D的相机跟随、视野缩放以及旋转
- Tensorflow函数说明(4)—— variable_scope/name_scope
- 2014第五届 蓝桥杯C语言B组预赛题