error LNK2019: 无法解析的外部符号 "public: __thiscall cv::SIFT::SIFT(int,int,double,doubl

iceberg0 2015-04-20 10:02:12
代码在这
#include "stdafx.h"
#include "highgui.h"
#include "nonfree/features2d.hpp"
#include <iostream>
#include<opencv2/legacy/legacy.hpp>
using namespace std;
using namespace cv;

void main(int argc, char* argv[])
{
Mat input1=imread("1.jpg",1);
Mat input2=imread("2.jpg",1);
SiftFeatureDetector detector;
vector<KeyPoint> keypoint1,keypoint2;
detector.detect(input1,keypoint1);

Mat output1;
drawKeypoints(input1,keypoint1,output1);
imshow("sift_result1.jpg",output1);
imwrite("sift_result1.jpg",output1);

Mat output2;
SiftDescriptorExtractor extractor;
Mat descriptor1,descriptor2;
BruteForceMatcher<L2<float>> matcher;

vector<DMatch> matches;
Mat img_matches;
detector.detect(input2,keypoint2);
drawKeypoints(input2,keypoint2,output2);

imshow("sift_result2.jpg",output2);
imwrite("sift_result2.jpg",output2);

extractor.compute(input1,keypoint1,descriptor1);
extractor.compute(input2,keypoint2,descriptor2);

matcher.match(descriptor1,descriptor2,matches);

drawMatches(input1,keypoint1,input2,keypoint2,matches,img_matches);
imshow("matches",img_matches);
imwrite("matches.jpg",img_matches);

waitKey();


}
...全文
1149 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
你的图片路径是哪里,我读取不了图片
城江再歌山 2015-04-23
  • 打赏
  • 举报
回复
添加“opencv_nonfree249d.lib” 即可。 如果还不行,把“opencv_legacy249d.lib”也添上。 249是版本号,对应你自己的版本号,去目录(\opencv\build\x64\vc10\lib)下找到它把名字复制。
iceberg0 2015-04-23
  • 打赏
  • 举报
回复
引用 7 楼 zshuaihua 的回复:
添加“opencv_nonfree249d.lib” 即可。 如果还不行,把“opencv_legacy249d.lib”也添上。 249是版本号,对应你自己的版本号,去目录(\opencv\build\x64\vc10\lib)下找到它把名字复制。
这是对的 解决问题
此后三年 2015-04-21
  • 打赏
  • 举报
回复
重新配置一下环境变量,绝对是少了,注意***d.lib 和***.lib的区别 有d的是debug版本, 没有的是release版本, 要和你的对应上
假正经的班长 2015-04-21
  • 打赏
  • 举报
回复
引用 4 楼 iceberg0 的回复:
[quote=引用 1 楼 cjqpker 的回复:] 需要引入相关的lib文件
具体是哪个lib呢 我好像都已经添加进去了 文件 目录什么的 [/quote] 看这样子,应该是OpenCV的吧,可能遗漏了哪个
iceberg0 2015-04-21
  • 打赏
  • 举报
回复
引用 1 楼 cjqpker 的回复:
需要引入相关的lib文件
具体是哪个lib呢 我好像都已经添加进去了 文件 目录什么的
赵4老师 2015-04-21
  • 打赏
  • 举报
回复
项目、属性、链接器、常规、附加库目录:填写附加依赖库所在目录 分号间隔多项 项目、属性、链接器、输入、附加依赖项:填写附加依赖库的名字.lib 空格或分号间隔多项
此后三年 2015-04-21
  • 打赏
  • 举报
回复
1l +1, 在项目属性VC++目录-》库目录中加lib的路径
假正经的班长 2015-04-21
  • 打赏
  • 举报
回复
需要引入相关的lib文件

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧