Ask Your Question
0

'filter2D' : is not a member of 'cv'?

asked 2013-05-25 06:16:23 -0600

rockinfresh gravatar image

updated 2013-05-25 06:45:28 -0600

Guanta gravatar image

hi everyone,

I keep having the 2 errors:

1>c:\users\aaron\documents\visual studio 2010\projects\sharpen2d\sharpen2d\sharpen2d\main.cpp(45): error C2039: 'filter2D' : is not a member of 'cv' 1>c:\users\aaron\documents\visual studio 2010\projects\sharpen2d\sharpen2d\sharpen2d\main.cpp(45): error C3861: 'filter2D': identifier not found

Do anybody know why?

My program is as follows:

#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\features2d\features2d.hpp>
#include <opencv2\calib3d\calib3d.hpp>


void sharpen2D(const cv::Mat &img, cv::Mat &result)
{
    //construct the kernel such that all entries are initialised to 0
    cv::Mat kernel(3,3,CV_32F,cv::Scalar(0));
    //assign the kernels value
    kernel.at<float>(1,1) = 5.0;
    kernel.at<float>(0,1) = -1.0;
    kernel.at<float>(1,0) = -1.0;
    kernel.at<float>(2,1) = -1.0;
    kernel.at<float>(1,2) = -1.0;

    //now filter the image
    cv::filter2D (img, result, img.depth(), kernel);
}


int main(){

    cv::Mat img(cvLoadImage("rendered_lena.png"));

    cv::Mat imgClone= img.clone();

    sharpen2D(img,imgClone); //change the number to reflect the color reduction property

    cv::namedWindow("Results", CV_WINDOW_AUTOSIZE);

    cv::imshow("Results", imgClone);

    cv::waitKey(0);

}

I initially thought it was the include library problem, but apparently it's not. Any idea anybody?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-05-25 06:44:34 -0600

Guanta gravatar image

updated 2013-05-25 06:48:52 -0600

You write:

I initially thought it was the include library problem, but apparently it's not. Any idea anybody?

However,

#include <opencv2/imgproc/imgproc.hpp>

is missing. (Additionally, you need to link against imgproc as well, but I guess you are doing that already)

edit flag offensive delete link more

Comments

Actually, thanks! It was the imgproc.hpp lib. I don't really know what function belongs to what library! Thanks (:

rockinfresh gravatar imagerockinfresh ( 2013-05-27 08:11:15 -0600 )edit

thanx, it help me a lot!

Chase07 gravatar imageChase07 ( 2017-02-28 06:25:09 -0600 )edit

Question Tools

Stats

Asked: 2013-05-25 06:16:23 -0600

Seen: 5,323 times

Last updated: May 25 '13