I need to draw two types of histogram, namely monodimensional and tridimensional. I\'m a newbie to EMGU and all of the samples I found on the net are in C++ or C. Are there
It is important to follow the procedure to add the Emgu.CV.UI.dll to your toolbox in Windows Forms in order to use all of the Windows Forms controls that Emgu CV provides (HistogramBox included.)
First of all you need to open your form in designer view. From Toolbox, right click in the empty space of 'General' column. This should pop up a selection menu, where 'Choose Items' selection is available, see image below.
Afterwards, click on 'Choose Items'; you will see a 'Choose Toolbox Item' Dialog. From there click the 'Browse..' button on the lower right corner of the dialog.
Select 'Emgu.CV.UI.dll' file from 'Open' dialog, click the 'Open' button. Now you should notice the ImageBox control has been added to the 'Choose Toolbox Items' dialog. Click 'Ok'. Then you should note the following controls added to your Toolbox (Applies for version 3.10 of Emgu. Some other versions of Emgu may have other controls or lack the controls mentioned below.)
Then you should be able to drag and drop to your form as you see fit the Windows Forms controls that Emgu CV has built-it. Or you should be able to use them programmatically:
Form frm = new Form();
var img = CvInvoke.Imread(this.PictureBox.ImageLocation, Emgu.CV.CvEnum.LoadImageType.Grayscale).ToImage();
HistogramBox histo = new HistogramBox();
histo.ClearHistogram();
histo.GenerateHistograms(img, 256);
histo.Dock = DockStyle.Fill;
histo.Refresh();
frm.Controls.Add(histo);
frm.ShowDialog();
This answer was inspired in the Add Image Box Control tutorial.