示例#1
0
文件: Form1.cs 项目: Lipotam/DSP
 private void button2_Click(object sender, EventArgs e)
 {
     image = new ImageRecognizer((Bitmap)pictureBox1.Image, (byte)separateValue.Value,(int)MinSquare.Value,(int)KMedianNumber.Value,(double)areaCoefficient.Value,
         (double)perimeterCoefficient.Value, (double)elongationCoefficient.Value, (double)DensityCoefficient.Value, (double)massCenterCoefficient.Value);
     image.TransformToBlackAndWhite();
     pictureBox2.Image = image.OutputImage;
     image.RecognizePixelsToGroups();
     image.SetPixelsToObjectGroupsWithFilter();
     image.SetObjectsToGroups();
     image.PaintFromGroupMap();
     pictureBox3.Image = image.OutputImage;
     DrawHistogram(zedGraphControl2, pictureBox1);
 }
示例#2
0
文件: Form1.cs 项目: Lipotam/DSP
        private void DrawTheImage()
        {
            ImageRecognizer imageRecongizer = new ImageRecognizer(this.image, 128, 0);
            imageRecongizer.TransformToBlackAndWhite();
            this.image = imageRecongizer.OutputImage;
            for (int i = 0; i < this.width; i++)
            {
                for (int j = 0; j < this.height; j++)
                {
                    if (this.image.GetPixel(i, j).R == 0)
                    {
                        this.draws[j * this.width + i] = 1;
                    }
                    else
                    {
                        this.draws[j * this.width + i] = -1;
                    }
                }
            }

            this.panel1.Refresh();
        }
示例#3
0
文件: Form1.cs 项目: Lipotam/DSP
 private void button2_Click(object sender, EventArgs e)
 {
     image = new ImageRecognizer((Bitmap)pictureBox1.Image,(byte)separateValue.Value,0);
     image.TransformToBlackAndWhite();
     pictureBox2.Image = image.OutputImage;
     image.RecognizePixelsToGroups();
     image.PaintFromGroupMap();
     pictureBox3.Image = image.OutputImage;
     DrawHistogram(zedGraphControl2, pictureBox1);
 }