我正在尝试inpaint
在 opencv 中使用该函数,但出现此错误
loadimg.cpp: In function 'int main(int, char**)':
loadimg.cpp:19:28: error: 'INPAINT_TELEA' is not a member of 'cv'
loadimg.cpp:19:45: error: 'inpaint' was not declared in this scope
从输入这个:
C:\Users\Francesco\Desktop\prova>g++ -I"C:\opencv\build\include"
-L"C:\opencv\build\x86\mingw\lib" loadimg.cpp -lopencv_core245 -lopencv_highgui245
-lopencv_img proc245 -o loadimg
这是我的代码:
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv/cv.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
Mat src = cv::imread("prova.jpg");
Mat mask;
cvtColor(src, mask, CV_RGB2GRAY);
threshold(mask, mask, 220, 255, CV_THRESH_BINARY);
Mat dst;
inpaint(src, mask, dst, 1, cv::INPAINT_TELEA);
imshow("image", dst);
waitKey(0);
return 0;
}
谁能帮我?非常感谢。