0

I need to do a (fast) median filter of some images from Python, and after some time on Google it seems like OpenCV is the way to go for speed (even in Python). I got OpenCV up and running, and filters like Erode and Dilate works fine:

cv.Erode(cv_im,cv_im,None,6) cv.Dilate(cv_im,cv_im,None,6) 

The Median filter, however, does not seem to work:

cv.Smooth(cv_im,cv_im,CV_MEDIAN) 

"NameError: global name 'CV_MEDIAN' is not defined"

I can't seem to figure out what I'm doing wrong, according to the documentation http://opencv.willowgarage.com/documentation/python/image_filtering.html#smooth it looks like I do it the correct way.

Any ideas? Many thanks in advance!

1 Answer 1

3

Looks like you imported pyopencv as "cv". So you editting CV_MEDIAN to cv.CV_MEDIAN should help

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.