Ejemplo n.º 1
0
        public void Analysis()
        {
            if (m_bitmap != null)
            {
                double[, ,] rgb = m_pipeline.bmp2rgb(m_bitmap);
                double[, ,] XYZ = m_pipeline.rgb2xyz(rgb);

                switch (m_panel)
                {
                case ColorPanel.White:
                case ColorPanel.Black:
                    this.Luminance   = m_pipeline.getlv(XYZ);
                    this.Uniformity5 = m_pipeline.getuniformity(XYZ);
                    this.Mura        = m_pipeline.getmura(XYZ);
                    break;

                case ColorPanel.Red:
                case ColorPanel.Green:
                case ColorPanel.Blue:
                {
                    double[] xyY = m_pipeline.getxyY(XYZ);
                    CIE1931xyY.x = xyY[0];
                    CIE1931xyY.y = xyY[1];
                    CIE1931xyY.Y = xyY[2];
                }
                break;
                }
            }
        }
Ejemplo n.º 2
0
        private void DrawZone(Bitmap binImage, ColorPanel panel)
        {
            string     imageName = string.Format("{0}{1}{2:yyyyMMddHHmmss}_{3}", IMAGE_SAVE_PATH, SerialNumber, DateTime.Now, panel.ToString());
            zoneresult zr        = new zoneresult();
            Graphics   g         = Graphics.FromImage(binImage);

            for (int i = 1; i < 6; i++)
            {
                // get corner coordinates
                List <IntPoint> flagPoints = zr.zonecorners(i, 10, ip.bmp2rgb(binImage));
                // zone image
                g = ZoneImage(g, flagPoints);
                binImage.Save(IMAGE_SAVE_PATH + i.ToString() + "_" + panel.ToString() + "_bin_zone.bmp");
                flagPoints.Clear();
            }

            binImage.Save(imageName + "_bin_zone1-5.bmp");
            //refreshtestimage(binImage, picturebox_test);
            args.Image = binImage;
            dataChange.Invoke(this, args);
            g.Dispose();
        }