public void Analysis(ref TestItem item, DUTclass.DUT dut)
        {
            int points = 9;

            if (dut is DUTclass.Hodor)
            {
                points = 13;
            }
            else if (dut is DUTclass.Bran)
            {
                points = 9;
            }


            if (m_bitmap != null)
            {
                double[, ,] rgb = m_pipeline.bmp2rgb(m_bitmap);
                double[, ,] XYZ = m_pipeline.rgb2xyz(rgb);
                double[] xyY = m_pipeline.getxyY(XYZ);
                item.TestNodes[3].Value = Math.Round(xyY[0], 5);
                item.TestNodes[4].Value = Math.Round(xyY[1], 5);
                item.TestNodes[0].Value = item.TestNodes[5].Value = Math.Round(xyY[2], 3);

                if (m_bitmapDisp != m_bitmap)
                {
                    rgb = m_pipeline.bmp2rgb(m_bitmapDisp);
                    XYZ = m_pipeline.rgb2xyz(rgb);
                    //xyY = m_pipeline.getxyY(XYZ);
                }
                //item.TestNodes[5].Value = item.TestNodes[0].Value = Math.Round(m_pipeline.getlv(XYZ), 3);
                item.TestNodes[1].Value = Math.Round(m_pipeline.getuniformity(XYZ, points), 3);
                item.TestNodes[2].Value = Math.Round(m_pipeline.getmura(XYZ), 0);
                item.TestNodes[0].Value = item.TestNodes[5].Value = Math.Round(m_pipeline.lvValue.Max(), 3);
            }
        }
Exemple #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();
        }