【问题标题】:How to display EMGU histogram in chart control?如何在图表控件中显示 EMGU 直方图?
【发布时间】:2012-09-25 22:26:50
【问题描述】:

我有以下代码示例:

    //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);

计算出直方图后,我想在图表控件中显示结果。

有人可以提供实现这一点的想法/示例代码吗?谢谢。

【问题讨论】:

    标签: .net opencv charts histogram emgucv


    【解决方案1】:

    HistogramBox 控件让您自动显示图像直方图。

    关注emgu instructions 以获取您可以拖放到表单上的整个控件列表。那么它只是几个方法调用。

    histogramBox.GenerateHistograms(img,bin); //bin = 256 in your example
    
    histogramBox2.Refresh();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-18
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 2012-07-08
      相关资源
      最近更新 更多