#include<opencv2\core.hpp>
#include<opencv2\highgui.hpp>
#include<opencv2\imgproc.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main()
{
Mat points = (Mat_<float>(5, 2) << 1, 1, 5, 1, 1, 10, 5, 10, 2, 5);
RotatedRect rRect = minAreaRect(points);
cout << "旋转矩阵的角度" << rRect.angle << endl;
cout << "旋转矩阵的中心" << rRect.center << endl;
cout << "旋转矩阵的尺寸" << rRect.size << endl;
system("pause");
return 0;
}
输出结果为:
由于Windows系统自己更新,出现的问题。
解决:
上面输出的DOS界面点击右键-->属性-->选择使用旧版本的控制台