ResultBean.cs 2.3 KB
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace AOI
{
    public class ResultBean
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="type">类型,1=mark点。2=斑点分析,3=颜色抽取,4=模板匹配,5=颜色匹配</param>
        public ResultBean(string name,int type,double targetMinV,double targetMaxV)
        {
            this.MethodName = name;
            this.MethodType = type;
            this.targetMinValue = targetMinV;
            this.targetMaxValue = targetMaxV;
        }
        /// <summary>
        /// 名称
        /// </summary>
        public string MethodName;
        /// <summary>
        /// AOI标识
        /// </summary>
        public string labelKey;
        /// <summary>
        /// AOI检测结果,true表示OK, false表示NG
        /// </summary>
        public bool result = false;
        /// <summary>
        /// 标准区域图片
        /// </summary>
        public Image standardRoiImage;
        /// <summary>
        /// 当前区域图片
        /// </summary>
        public Image currentRoiImage;

        public GraphicsPath roiPath;


        public double targetMinValue;
        public double targetMaxValue;
        /// <summary>
        /// 当为mark点和模板匹配时表示相似度。
        /// 为颜色抽取表示像素占比
        /// </summary>
        public double percentValue;

        /// <summary>
        /// 类型,1=mark点。2=斑点分析,3=颜色抽取,4=模板匹配,5=颜色匹配
        /// </summary>
        public int MethodType = 0;

        /// <summary>
        /// 颜色抽取时表示List<CvBlob> blobList
        /// </summary>
        public object checkData;


        public void Dispose()
        {
            if (standardRoiImage!=null)
            {
                standardRoiImage.Dispose();
            }
            if (currentRoiImage != null)
            {
                currentRoiImage.Dispose();
            }
            if (roiPath != null)
            {
                roiPath.Dispose();
            }            
        }
    }
}