added size check to static Mat::diag()
This commit is contained in:
parent
25261e6ebc
commit
645bb0bfbc
@ -338,6 +338,7 @@ inline Mat Mat::colRange(const Range& r) const
|
|||||||
|
|
||||||
inline Mat Mat::diag(const Mat& d)
|
inline Mat Mat::diag(const Mat& d)
|
||||||
{
|
{
|
||||||
|
CV_Assert( d.cols == 1 );
|
||||||
Mat m(d.rows, d.rows, d.type(), Scalar(0)), md = m.diag();
|
Mat m(d.rows, d.rows, d.type(), Scalar(0)), md = m.diag();
|
||||||
d.copyTo(md);
|
d.copyTo(md);
|
||||||
return m;
|
return m;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user