// get the uniformity by 5 zones. public double getuniformity(double[, ,] XYZ, int pointNums) { int productType = 0; zoneresult zr = new zoneresult(); List <double> pointLv = new List <double>(); string value = ""; if (pointNums < 9) { pointNums = 9; productType = 0; } else { pointNums = 13; productType = 1; } zr.clear(); for (int i = 0; i < pointNums; i++) { double[, ,] XYZValue = zr.XYZlocalzone(productType, (i + 1), 10, XYZ); double a = getlv(XYZValue); pointLv.Add(a); } if (log == null) { log = new Testlog(); } pointLv = PointLV(pointLv); for (int i = 0; i < pointNums; i++) { value = string.Format("{0},{1}", value, pointLv[i]); } log.AppendCamareVaule(value); lvvalue = pointLv; double lvMax = pointLv.ToArray().Max(); double lvMin = pointLv.ToArray().Min(); double unif = lvMin / lvMax; return(unif); }
private void DrawZone(Bitmap binImage, string panelName) { int productType = 0; if (dut is DUTclass.Bran) { productType = 0; } else if (dut is DUTclass.Hodor) { productType = 1; } string imageName = string.Format("{0}{1}{2:yyyyMMddHHmmss}_{3}.bmp", IMAGE_SAVE_PATH, SerialNumber, DateTime.Now, panelName); zoneresult zr = new zoneresult(); Graphics g = Graphics.FromImage(binImage); double[, ,] XYZ = ip.bmp2rgb(binImage); zr.clear(); for (int i = 1; i < (this.TestPoints + 1); i++) { // get corner coordinates List <IntPoint> flagPoints = zr.zonecorners(productType, i, 10, XYZ); // zone image g = ZoneImage(g, flagPoints); binImage.Save(IMAGE_SAVE_PATH + i.ToString() + "_" + panelName.ToString() + "_bin_zone.bmp"); flagPoints.Clear(); } binImage.Save(imageName + "_bin_zone1-" + this.TestPoints + ".bmp"); //refreshtestimage(binImage, picturebox_test); args.Image = new Bitmap(binImage); dataChange.Invoke(this, args); g.Dispose(); }