1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using OpenCvSharp;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SmartCoalApplication.Base.AutoMeasure
- {
- public class AutoMeasureAnalysis
- {
- public bool erzhichuli = false;// true;//false;
- public bool fanweibuchang = false;
- public bool daodianbu = false;
- public int number;
- public int wrongNumber;
- public int success;
- public Mat result = new Mat();
- public bool isNewSuanfa = true;
- public List<DataInfor> dataInfors = new List<DataInfor>();
- public void UpdateSuccessLine()
- {
- success++;
- wrongNumber = number - success;
- }
- public void setErzhichuli(bool isErzhichuli)
- {
- this.erzhichuli = isErzhichuli;
- }
- public void setFanweibuchang(bool isFanweibuchang)
- {
- this.fanweibuchang = isFanweibuchang;
- }
- public void setBool(bool isDaodianbu)
- {
- this.daodianbu = isDaodianbu;
- }
- public void setIsNewSuanfa(bool isNewSuanfa)
- {
- this.isNewSuanfa = isNewSuanfa;
- }
- public void Label(Mat image)
- {
- Point p1 = new Point();
- Point p2 = new Point();
- Ceju ceju = new Ceju();
- for (int i = 0; i < dataInfors.Count; i++)
- {
- p1.X = dataInfors[i].point1.X;
- p1.Y = dataInfors[i].point1.Y;
- p2.X = dataInfors[i].point2.X;
- p2.Y = dataInfors[i].point2.Y;
- if (dataInfors[i].point1.Y == dataInfors[i].point2.Y)
- {
- ceju.LabelHorizontal(image, p1, p2, dataInfors[i].value);
- }
- else
- {
- ceju.LabelVertical(image, p1, p2, dataInfors[i].value);
- }
- }
- }
- public virtual void Compute(Mat mat, bool flag, int X, int Y)
- {
- }
- }
- }
|