a a
a a

Reputation: 35

getting error while calling function / c++ and opencv

I have written a function(High) which has a Mat as an output. I am going to use this returned Mat in another function(Filter) to use it as an input for MedianBlur(). This is what I mean:

High(); 
Filter();   

Mat Data::High(float* distances){
        Mat Matdis;
...
    return Matdis;
} 


 void Data::Filter(){
    High();
    MedianBlur(Matdis,Matdis,ksize);
 }

I get error in MedianBlur line...does anyone know what is the reason?

Thanks in advance..

Upvotes: 0

Views: 201

Answers (1)

Mike Seymour
Mike Seymour

Reputation: 254431

Presumably, the error message that you forgot to post tells you that Matdis wasn't declared in the scope of Filter. If you want to pass the return value of High as the input of MedianBlur, then you'll need to get the return value:

Mat high = High(distances);    // You'll need an argument for this function
MedianBlur(high, high, ksize);

Upvotes: 2

Related Questions