Commit 3108423a authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed assert placement in cv::invert

parent 88c934ea
...@@ -947,6 +947,9 @@ double cv::invert( InputArray _src, OutputArray _dst, int method ) ...@@ -947,6 +947,9 @@ double cv::invert( InputArray _src, OutputArray _dst, int method )
bool result = false; bool result = false;
Mat src = _src.getMat(); Mat src = _src.getMat();
int type = src.type(); int type = src.type();
CV_Assert(type == CV_32F || type == CV_64F);
size_t esz = CV_ELEM_SIZE(type); size_t esz = CV_ELEM_SIZE(type);
int m = src.rows, n = src.cols; int m = src.rows, n = src.cols;
...@@ -969,7 +972,7 @@ double cv::invert( InputArray _src, OutputArray _dst, int method ) ...@@ -969,7 +972,7 @@ double cv::invert( InputArray _src, OutputArray _dst, int method )
((double*)w.data)[n-1]/((double*)w.data)[0] : 0); ((double*)w.data)[n-1]/((double*)w.data)[0] : 0);
} }
CV_Assert( m == n && (type == CV_32F || type == CV_64F)); CV_Assert( m == n );
if( method == DECOMP_EIG ) if( method == DECOMP_EIG )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment