#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main()
{
// load the image
Mat img = imread("C:\\Users\\prashant naresh\\Documents\\Visual Studio 2010\\Projects\\nonlocalfilter\\image.jpg");
if(!img.data) {
cout << "File not found" << endl;
return -1;
}
// show it in a window
namedWindow( "Image", WINDOW_AUTOSIZE );
imshow("Image", img);
// image window will immediately disappear if the program ends, so
// we'll wait for a keypress, indefinitely
waitKey();
// do a simple transformation: convert to grayscale
// first copy the image
Mat img_gray = img.clone();
Mat img1;
cvtColor(img, img_gray, CV_RGB2GRAY);
fastNlMeansDenoising(img_gray,img1,3.0,7,21);
imshow("Image", img1);
waitKey();
return 0;
}
ERROR:
error LNK2019: unresolved external symbol "void __cdecl cv::fastNlMeansDenoising(class cv::_InputArray const &,class cv::_OutputArray const &,float,int,int)" (?fastNlMeansDenoising@cv@@YAXABV_InputArray@1@ABV_OutputArray@1@MHH@Z) referenced in function _main
Error 2 error LNK1120: 1 unresolved externals c:\users\prashant naresh\documents\visual studio 2010\Projects\nonlocalfilter\Debug\nonlocalfilter.exe nonlocalfilter
答案 0 :(得分:2)
好像你忘了链接opencv_photo249.lib //或者你正在使用的任何版本
答案 1 :(得分:0)