.net 如何在图表控件中显示EMGU直方图?
我有以下代码示例:.net 如何在图表控件中显示EMGU直方图?,.net,opencv,charts,histogram,emgucv,.net,Opencv,Charts,Histogram,Emgucv,我有以下代码示例: //creating histogram using emgu cv c# //Create a grayscale image Image<Gray, Byte> img = new Image<Gray, byte>(400, 400); // Fill image with random values img.SetRandUniform(new MCvScalar(), new MCvScalar
//creating histogram using emgu cv c#
//Create a grayscale image
Image<Gray, Byte> img = new Image<Gray, byte>(400, 400);
// Fill image with random values
img.SetRandUniform(new MCvScalar(), new MCvScalar(255));
// Create and initialize histogram
DenseHistogram hist = new DenseHistogram(256, new RangeF(0.0f, 255.0f));
// Histogram Computing
hist.Calculate<Byte>(new Image<Gray, byte>[] { img }, true, null);
//使用emgu cv c创建直方图#
//创建灰度图像
图像img=新图像(400400);
//用随机值填充图像
img.SetRandUniform(new MCvScalar(),new MCvScalar(255));
//创建并初始化直方图
DenseShistogram hist=新的DenseShistogram(256,新范围(0.0f,255.0f));
//直方图计算
计算(新图像[]{img},true,null);
计算直方图后,我想在图表控件中显示结果
有人能提供实现这个的想法/示例代码吗?谢谢。Historogrambox控件允许您自动显示图像直方图 按照下面的步骤获得可以在窗体上拖放的控件的完整列表。然后就是几个方法调用
histogramBox.GenerateHistograms(img,bin); //bin = 256 in your example
histogramBox2.Refresh();