OpenCV Mat实例详解 一、二介绍了,OpenCV Mat类构造函数及其公共属性。下面继续介绍OpenCV Mat类公有静态成员函数 OpenCV Mat类公有静态成员函数(Static Public Member Functions) static Mat (const Mat &d); 该函数用已有的Mat对象的数据矩阵对角线上的数据填充新创建Mat对象数据矩阵。下面创建一个空的控制台应用程序,来演示其用法·,在程序中加入如下代码: // OpenCVMatTest3.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; int main() { Mat src = (Mat_<uchar>(3, 3 ) << 1, 0, 0, 0, 1, 0, 0, 0, 1); Mat dst = src.diag(); cout << src << endl; cout <<...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with dst.setDefault
Contact dst.setDefault, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack