void DisplayResultHisto(ImgPResult data) { HistoBox.ClearHistogram(); HistoBox.Name = "AreaSize"; AddHist2Box(HistoBox, ref HistogramList, HistoFromResult(data), ( bool )ckbSetHistRange.IsChecked ? float.Parse(nudHistDW.Text) : 0, ( bool )ckbSetHistRange.IsChecked ? float.Parse(nudHistUP.Text) : 255); HistoBox.Refresh(); WinHost.Child = HistoBox; //canvasHist.Children.Clear(); //canvasHist.Children.Add( WinHost ); }
void DisplayResultHisto(ImgPResult data) { HistoBox.ClearHistogram(); var passfun = curry(HistoFromResult(data)); // Passing Form AddHist2Box(HistoBox, HistogramList, passfun, ( bool )ckbSetHistRange.IsChecked ? float.Parse(nudHistDW.Text) : 0, ( bool )ckbSetHistRange.IsChecked ? float.Parse(nudHistUP.Text) : 255); HistoBox.Refresh(); WinHost.Child = HistoBox; canvasRB.Children.Clear(); canvasRB.Children.Add(WinHost); }
private void AddHistogram(Image <Bgr, byte> image, Color color, HistogramBox histogramBox) { using (DenseHistogram histogram = new DenseHistogram(256, new RangeF(0f, 255f))) { Mat mat = new Mat(); if (color == Color.Black) { histogram.Calculate(new Image <Gray, byte>[] { image.Convert <Gray, byte>() }, false, null); } else if (color == Color.Blue) { histogram.Calculate(new Image <Gray, byte>[] { image[0] }, false, null); } else if (color == Color.Red) { histogram.Calculate(new Image <Gray, byte>[] { image[1] }, false, null); } else if (color == Color.Green) { histogram.Calculate(new Image <Gray, byte>[] { image[2] }, false, null); } else { return; } histogram.CopyTo(mat); histogramBox.ClearHistogram(); histogramBox.AddHistogram(color.ToString(), color, mat, 256, new float[] { 0f, 255f }); histogramBox.Refresh(); } }
void RefreshHistogram() { try { if (!ProcessDone && HistogramList != null) { HistoBox.ClearHistogram(); AddHist2Box(HistoBox, ref HistogramList, HistoFromImage(Core.OriginImg, Core.BinSize), (bool)ckbSetHistRange.IsChecked ? float.Parse(nudHistDW.Text) : 0, (bool)ckbSetHistRange.IsChecked ? float.Parse(nudHistUP.Text) : 255); } } catch (Exception) { System.Windows.Forms.MessageBox.Show("Please Input only Number on Histogram Range"); } }
void DisplayResultHisto(ImgPResult data) { try { HistoBox.ClearHistogram(); var passfun = HistoFromResult(data); // Passing Form AddHist2Box(HistoBox, HistogramList, passfun); HistoBox.Refresh(); WinHost.Child = HistoBox; canvasRB.Children.Clear(); canvasRB.Children.Add(WinHost); } catch (Exception) { } }
private void BtnFotoSec_Click_1(object sender, EventArgs e) { string FotoGetir = DosyaAdiGetir(); Image <Bgr, byte> renkliFoto = new Image <Bgr, byte>(FotoGetir); FotoImageBox.Image = renkliFoto; //gri image Image <Gray, byte> griFoto = GriGetir(renkliFoto); GriImageBox.Image = griFoto; //binary image Image <Gray, byte> binaryFoto = BinaryGetir(griFoto); BinaryImageBox.Image = binaryFoto; //histogram Mat m = HistogramGetir(griFoto); HistogramBox.ClearHistogram(); HistogramBox.AddHistogram("Gri Histogram", Color.Gray, m, 256, new float[] { 0.0f, 256.0f }); HistogramBox.Refresh(); }