Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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?

click to hide/show revision 2
No.2 Revision

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

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>

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

-1.0;

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

}

} int main(){

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?