private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Dictionary<int, int> mapPixels = new Dictionary<int,int>(); int optimalThreshold; ImageMap = new Bitmap(comboBox1.Text); LogicSegmentation segmentation = new LogicSegmentation(ImageMap); segmentation.decomposeRGB(); segmentation.greyScale(); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); mapPixels = segmentation.getMapOfPixels(); LogicOptimalThreshold threshold = new LogicOptimalThreshold(mapPixels); optimalThreshold = threshold.OptimalThreshold; pictureHistogram.Image = segmentation.getHistogram(mapPixels, optimalThreshold); segmentation.decomposeRGB(); segmentation.binarization(optimalThreshold); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); pictureBox1.Image = ImageMap; labelUmbral.Text = optimalThreshold.ToString(); Dictionary<int, DTOBinaryObject> binaryObjects = segmentation.generateBinaryObjects(); LogicTanimoto tanimoto = new LogicTanimoto(binaryObjects); label2.Text = tanimoto.getPlate(); }
private void numericUpDown1_ValueChanged(object sender, EventArgs e) { LogicSegmentation segmentation = new LogicSegmentation(ImageMap); segmentation.decomposeRGB(); segmentation.greyScale(); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); segmentation.decomposeRGB(); segmentation.binarization((int)numericUpDown1.Value); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); pictureBox1.Image = segmentation.getImageMap(); Dictionary<int, DTOBinaryObject> binaryObjects = segmentation.generateBinaryObjects(); LogicTanimoto tanimoto = new LogicTanimoto(binaryObjects); label2.Text = tanimoto.getPlate(); }
private void objetosBinariosToolStripMenuItem_Click(object sender, EventArgs e) { LogicSegmentation segmentation = new LogicSegmentation((Bitmap)this.PBImagen.Image); segmentation.decomposeRGB(); segmentation.greyScale(); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); segmentation.decomposeRGB(); segmentation.binarization(125); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); segmentation.generateBinaryObjects(); PBImagen.Image = segmentation.getImageMap(); }
private void distanciaTinamotoToolStripMenuItem_Click(object sender, EventArgs e) { LogicSegmentation segmentation = new LogicSegmentation((Bitmap)this.PBImagen.Image); segmentation.decomposeRGB(); segmentation.greyScale(); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); segmentation.decomposeRGB(); segmentation.binarization(90); segmentation.composeRGB(); segmentation.setMapImage(segmentation.getImageMap()); Dictionary<int, DTOBinaryObject> binaryObjects = segmentation.generateBinaryObjects(); PBImagen.Image = segmentation.getImageMap(); UITanimoto tanimoto = new UITanimoto(binaryObjects); tanimoto.Show(); }