mirror of
https://github.com/opencv/opencv.git
synced 2024-12-03 00:10:21 +08:00
Fixed MSVC warning in Mat::diag
This commit is contained in:
parent
626afecaf8
commit
b31f468921
@ -320,7 +320,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 || d.rows == 1 );
|
CV_Assert( d.cols == 1 || d.rows == 1 );
|
||||||
Mat m(d.total(), d.total(), d.type(), Scalar(0)), md = m.diag();
|
int len = d.rows + d.cols - 1;
|
||||||
|
Mat m(len, len, d.type(), Scalar(0)), md = m.diag();
|
||||||
d.copyTo(md);
|
d.copyTo(md);
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user