Ask Your Question

medianBlur doesn't work

asked 2013-04-18 12:48:53 -0500

BigBadIrbis gravatar image

I'm using opencv 2.3.1 and visual studio 2008.Trying to use medianBlur, but here is error - "medianBlur" identifier not found. Why? Was it realized after 2.3.1?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-04-19 08:10:45 -0500

berak gravatar image

did you

#include "include/opencv2/imgproc.hpp"


and no, it already existed before 2.3.1

edit flag offensive delete link more


include "C:\opencv\include\opencv\imgproc.hpp" and there is:

//! smooths the image using median filter. CV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize ); But it doesn't work.

BigBadIrbis gravatar imageBigBadIrbis ( 2013-04-19 09:46:56 -0500 )edit

"But it doesn't work."

what do you mean ? a bit more effort, please ...

berak gravatar imageberak ( 2013-04-19 09:52:48 -0500 )edit

"medianBlur" identifier not found. i don't understand - maybe vs can use only imgproc_c.hpp? there is no anything abought medianBlur in imgproc_c.hpp. only in imgproc.hpp, but i included it, and medianBlur still not found. should i try to use imgproc_c from last version of opencv?

BigBadIrbis gravatar imageBigBadIrbis ( 2013-04-19 11:23:53 -0500 )edit

oh, maybe you hit a c++ problem with namespaces.

it's in namespace cv, so either:

  1. use: cv::medianBlur();
  2. or, add using namespace cv; after the #include ... lines.

imgproc_c.hpp has all the old, c-style, 1.0 version functions like cvSmooth

berak gravatar imageberak ( 2013-04-19 11:37:29 -0500 )edit

Thanks! :) Now it works!

BigBadIrbis gravatar imageBigBadIrbis ( 2013-04-19 12:04:58 -0500 )edit

oh, nice, click the hook, so it's solved ;)

berak gravatar imageberak ( 2013-04-19 12:28:19 -0500 )edit

Question Tools


Asked: 2013-04-18 12:48:53 -0500

Seen: 843 times

Last updated: Apr 19 '13