OpenCV的cv::normalize函數


 

 

 1 #include<opencv2/opencv.hpp>
 2 #include<iostream>
 3 
 4 using namespace std;
 5 using namespace cv;
 6 
 7 int main()
 8 {
 9     Mat mat1 = Mat(2, 2, CV_32FC1);
10     mat1.at<float>(0, 0) = 1.0f;
11     mat1.at<float>(0, 1) = 2.0f;
12     mat1.at<float>(1, 0) = 3.0f;
13     mat1.at<float>(1, 1) = 4.0f;
14     // 對於這種小矩陣,還有更簡單的賦值方式,找時間再改
15     cout << "Mat 1:" << endl;
16     cout << mat1 << endl;
17 
18     normalize(mat1, mat1, 1.0, 0.0, NORM_MINMAX);
19     cout << "Mat 2:" << endl;
20     cout << mat1 << endl;
21 }
View Code

 

參考:

https://windrocblog.sinaapp.com/?p=486

https://blog.csdn.net/cosmispower/article/details/64457406


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM