Andrey, Maria and I fixed Mat::diag()
This commit is contained in:
parent
ade6388d3a
commit
829e558d48
@ -319,8 +319,8 @@ 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 );
|
CV_Assert( d.cols == 1 || d.rows == 1 );
|
||||||
Mat m(d.rows, d.rows, d.type(), Scalar(0)), md = m.diag();
|
Mat m(d.total(), d.total(), 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