1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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
- {
- /// <summary>
- /// 编号
- /// </summary>
- public string guid;
- /// <summary>
- /// 轮廓点集合
- /// </summary>
- public OpenCvSharp.Point[] points;
- /// <summary>
- /// 轮廓宽度
- /// </summary>
- public int width;
- /// <summary>
- /// 轮廓高度
- /// </summary>
- public int height;
- /// <summary>
- /// 最高点
- /// </summary>
- public int topY;
- /// <summary>
- /// 最低点
- /// </summary>
- public int bottomY;
- /// <summary>
- /// 左侧点
- /// </summary>
- public int leftX;
- /// <summary>
- /// 右侧点
- /// </summary>
- public int rightX;
- /// <summary>
- /// 存储抠出来的小图,用于方便传递
- /// </summary>
- 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();
- }
- }
- }
|