using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SmartCoalApplication.Base.AuxiliaryCalcModel
{
public class XiGaoZModel
{
///
/// 编号
///
public string guid;
///
/// 轮廓点集合
///
public OpenCvSharp.Point[] points;
///
/// 轮廓宽度
///
public int width;
///
/// 轮廓高度
///
public int height;
///
/// 最高点
///
public int topY;
///
/// 最低点
///
public int bottomY;
///
/// 左侧点
///
public int leftX;
///
/// 右侧点
///
public int rightX;
///
/// 存储抠出来的小图,用于方便传递
///
public Mat mat;
public void SetPoints(OpenCvSharp.Point[] points)
{
this.points = points;
this.topY = this.points.Min(a => a.Y);
this.bottomY = this.points.Max(a => a.Y);
this.leftX = this.points.Min(a => a.X);
this.rightX = this.points.Max(a => a.X);
this.width = rightX - leftX;
this.height = bottomY - topY;
this.guid = Guid.NewGuid().ToString();
}
}
}