Is the function distanceTransform still supported? [closed]

asked 2016-02-10 15:05:48 -0600

JoeC gravatar image

I'm trying to use the function distanceTransform(...). However, my compiler keeps saying: namespace cv has no member distanceTransform Is this function still supported? Is it possible that I'm missing an include file?

I have also been looking for some example code. The documentation at link text says there is an example at link text, but that second webpage doesn't seem to exist.

I'm trying to get an exact result using maskSize = CV_DIST_MASK_PRECISE and distanceType = CV_DIST_L2. I do see that there was a previous question about this function link text. A response on June 13, 2014 confirmed a bug when specifically using these two values. I guess I'm hoping it got fixed in the intervening 1.5 years. Is that a safe assumption? Or should another parameterization be used?

Arch Linux x86_64 OpenCV 3.1.0 VS2013

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by JoeC
close date 2016-02-15 12:55:52.752738

Comments

My apologies, but I evidently don't understand LorenaGdl's response. I looked at the enumerations on the indicated page, and I tried changing CV_DIST_MASK_PRECISE and CV_DIST_L2 to cv::DIST_MASK_PRECISE and cv::DIST_L2, but then instead of just not liking the function distanceTransform, the compiler additional didn't like cv::DIST_MASK_PRECISE and cv::DIST_L2. Conversely, it had previous not objected to CV_DIST_MASK_PRECISE and CV_DIST_L2. I'm a bit of a newbie to OpenCV. Would you mind providing additional detail? Thanks.

JoeC gravatar imageJoeC ( 2016-02-10 15:34:37 -0600 )edit

I just was pointing out the most updated docs (you linked 2.4 docs, although you're using 3.1 version). The description of the function indicates additional info

LorenaGdL gravatar imageLorenaGdL ( 2016-02-10 15:54:20 -0600 )edit

Of course, you are correct. There was a version mismatch between the code and documentation that I was using. I didn't realize that fact until you explicitly pointed that out. I'm now using the correct documentation, and the code works. Thanks!

JoeC gravatar imageJoeC ( 2016-02-15 12:54:52 -0600 )edit