projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
626afec
)
Fixed MSVC warning in Mat::diag
author
Andrey Kamaev
<no@email>
Tue, 10 Apr 2012 22:57:01 +0000
(22:57 +0000)
committer
Andrey Kamaev
<no@email>
Tue, 10 Apr 2012 22:57:01 +0000
(22:57 +0000)
modules/core/include/opencv2/core/mat.hpp
patch
|
blob
|
history
diff --git
a/modules/core/include/opencv2/core/mat.hpp
b/modules/core/include/opencv2/core/mat.hpp
index
b68c997
..
0b72aff
100644
(file)
--- a/
modules/core/include/opencv2/core/mat.hpp
+++ b/
modules/core/include/opencv2/core/mat.hpp
@@
-320,7
+320,8
@@
inline Mat Mat::colRange(const Range& r) const
inline Mat Mat::diag(const Mat& d)
{
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);
return m;
}