Пример #1
0
        // 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);
        }
Пример #2
0
        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();
        }
Пример #3
0
        // get the uniformity by 5 zones.
        public double getuniformity(double[, ,] XYZ)
        {
            zoneresult zr = new zoneresult();

            double[, ,] XYZ1, XYZ2, XYZ3, XYZ4, XYZ5;
            double lv1, lv2, lv3, lv4, lv5;

            XYZ1 = zr.XYZlocalzone(1, 10, XYZ);
            lv1  = getlv(XYZ1);
            XYZ2 = zr.XYZlocalzone(2, 10, XYZ);
            lv2  = getlv(XYZ2);
            XYZ3 = zr.XYZlocalzone(3, 10, XYZ);
            lv3  = getlv(XYZ3);
            XYZ4 = zr.XYZlocalzone(4, 10, XYZ);
            lv4  = getlv(XYZ4);
            XYZ5 = zr.XYZlocalzone(5, 10, XYZ);
            lv5  = getlv(XYZ5);

            double lvmin = new double[] { lv1, lv2, lv3, lv4, lv5 }.Min();
            double lvmax = new double[] { lv1, lv2, lv3, lv4, lv5 }.Max();
            double unif = lvmin / lvmax;

            return(unif);
        }