#include <opencv2/opencv.hpp>
#include <vector>#include<iostream>
#include <math.h>
#include <cassert>
using namespace cv;
using namespace std;
double getAngle(Mat Image) {
//读入图片
if (Image.empty()) {
printf("图片没有加载出来");
return 0;
}
//去除图像边界杂点
for (int x = 0; x < Image.rows; x++) {
uchar* data_new = Image.ptr<uchar>(x);
for (int y = 0; y < Image.cols; y++) {
if (data_new[y] != 100 && data_new[y] != 150 && data_new[y] != 200) {
data_new[y] = 0;
}
}
}
for (int x = 0; x < Image.rows; x++) {
uchar* data_new = Image.ptr<uchar>(x);
for (int y = 0; y < Image.cols; y++) {
if (data_new[y] =