c++ - fastnlmeanfilter 链接错误

标签 c++ opencv

#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 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

最佳答案

似乎您忘记链接 opencv_photo249.lib//或您正在使用的任何版本

关于c++ - fastnlmeanfilter 链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21954122/

相关文章:

c++ - 当模板更改一小部分时共享模板功能的通用功能

python - 将多项式拟合转换回图像空间

c++ - 无法从 raspberry pi pico ( c sdk ) 发送串行数据

c++ - 将 native WebRTC 应用程序与 Visual Studio 链接

c++ - 如何在每 1 分钟后在 C++ 中执行特定代码

opencv - 比较仅由计算机评估的颜色时是否需要更改颜色空间?

python - SWIG 链接器: undefined symbol :_ZN2cv8fastFreeEPv (cv::fastFree(void*))

c++ - 如何在 Qt 4.8 (C++) 中使用 Video4Linux2 (v4l2) 在 OpenCV 2.4 中捕获视频?

opencv - OpenCV来自对象的独特计数

c++ - 从 32 位和 64 位二进制文​​件读取