/// <summary> /// Constructor /// </summary> /// <param name="filePath">Image filepath to open</param> public CtrlTabPage(string filePath) { InitializeComponent(); if (string.IsNullOrEmpty(filePath)) { throw new ArgumentNullException(nameof(filePath)); } FilePath = filePath; HistogramPanel.Dock = DockStyle.Fill; HistogramPanel.ZedGraphControl.IsShowPointValues = true; scDataHistogram.Panel2.Controls.Add(HistogramPanel); HistogramPanel.Refresh(); }
/// <summary> /// Start processing the image /// </summary> public void ProcessImage() { //Load the image from file and resize it for display ImgOriginal = new Image <Bgr, byte>(FilePath); //.Resize(400, 400, Emgu.CV.CvEnum.Inter.Linear, true); HistogramPanel.ClearHistogram(); HistogramPanel.GenerateHistograms(ImgOriginal, 256); HistogramPanel.Refresh(); //Convert the image to grayscale and filter out the noise ImgGray = ImgOriginal.Convert <Gray, Byte>().SmoothGaussian(5, 5, 0, 0) /*.PyrDown().PyrUp()*/; PopulateImageProperties(ImgOriginal); foreach (CtrlImageBox.FilterAlgorithm name in Enum.GetValues(typeof(CtrlImageBox.FilterAlgorithm))) { AddImageBox(name); } IsLoaded = true; }