why is the 3rd argument to cv::Dilate failing?
I am testing out erode and dilate fu开发者_运维知识库nctions in openCV2.2 but compilation fails because of the 3rd argument when I pass the following line:
dilate(gscaleImage, gscaleImage, 0, 18 );
can anyone shed a light on this for me please as this is how they've been coded in the examples. Thanks
OpenCV has both C and C++ interfaces. You're calling the C++ function cv::dilate but, judging by the arguments, it was actually meant to be cvDilate from the old-style C interface.
From the OpenCV Documentation (sorry for the formatting):
void dilate(const Mat& src, Mat& dst, const Mat& element, Point anchor=Point(-1, -1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue())
The third argument is const Mat& element
, which is definitely not an int
like 0. What exactly are you trying to accomplish?
For iterations, I'd do:
dilate(gscaleImage, gscaleImage, 0, iterations = 18);
精彩评论