Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

copy paste issue in opencv? #1697

Closed
rolandha opened this Issue · 2 comments

2 participants

@rolandha

The code in /addons/ofxopencv/libs/opencv/include/opencv2/core/mat.hpp in line 1331 ff is:

template static inline void max(const Mat_<Tp>& a, const Mat<Tp>& b, Mat<_Tp>& c)
{
cv::min((const Mat&)a, (const Mat&)b, (Mat&)c);
}

template static inline void max(const Mat_<Tp>& a, double s, Mat<_Tp>& c)
{
cv::min((const Mat&)a, s, (Mat&)c);
}

template static inline void max(double s, const Mat_<Tp>& a, Mat<_Tp>& c)
{
cv::min((const Mat&)a, s, (Mat&)c);
}

but obviously this is a copy past issue as min and max is inconsistent. the code should be like:

template static inline void max(const Mat_<Tp>& a, const Mat<Tp>& b, Mat<_Tp>& c)
{
cv::max((const Mat&)a, (const Mat&)b, (Mat&)c);
}

template static inline void max(const Mat_<Tp>& a, double s, Mat<_Tp>& c)
{
cv::max((const Mat&)a, s, (Mat&)c);
}

template static inline void max(double s, const Mat_<Tp>& a, Mat<_Tp>& c)
{
cv::max((const Mat&)a, s, (Mat&)c);
}

although this seems to be a opencv issue this needs to be fixed ...

@bilderbuchi
Owner

I agree, this is an openCV issue, it's known to them and apparently already fixed in openCV 2.4.0. Their fix diff is simple, so we could fix this here directly, or is an openCV update planned anyway? @arturoc @ofTheo ?

@bilderbuchi
Owner

Never mind, I just made a pull request. Somebody review and merge, please. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.