Impove the documentation for Mat::diag

pull/8370/head
Fangjun KUANG 8 years ago committed by GitHub
parent 502aa1f053
commit 3c15913f53
  1. 23
      modules/core/include/opencv2/core/mat.hpp

@ -1085,6 +1085,29 @@ public:
immediately below the main one.
- `d>0` is a diagonal from the upper half. For example, d=1 means the diagonal is set
immediately above the main one.
For example:
@code
Mat m = (Mat_<int>(3,3) <<
1,2,3,
4,5,6,
7,8,9);
Mat d0 = m.diag(0);
Mat d1 = m.diag(1);
Mat d_1 = m.diag(-1);
@endcode
The resulting matrices are
@code
d0 =
[1;
5;
9]
d1 =
[2;
6]
d_1 =
[4;
8]
@endcode
*/
Mat diag(int d=0) const;

Loading…
Cancel
Save