mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
Merge pull request #8370 from csukuangfj:patch-7
This commit is contained in:
commit
73e9c44377
@ -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…
Reference in New Issue
Block a user