c# - 如何创建直方图

标签 c# image histogram emgucv

我想在使用 EMGU 的 C# 程序中创建直方图。 EMGU里面有个叫MCvHistogram的类,不知道怎么用。

最佳答案

如果你想使用 EmguCV,你应该使用 DenseHistogram 类。 我将向您展示基本用法:

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

DenseHistogram 类中还有很多其他常用的方法,例如 Back Projection

关于c# - 如何创建直方图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4905893/

相关文章:

html - 尝试将 "information button"添加到我页面上的图片中,该图片仅在悬停时出现

opencv - OpenCv 中值数组的直方图

python - matplotlib - 用重叠的 x/y 刻度在同一轴上绘制两个直方图

r - 如何使用ggplot在直方图上叠加任意参数分布?

c# - 处理 --> Arduino --> Unity 通过端口通信

c# - C# 应该有惰性关键字吗

javascript - 识别网络套接字客户端

c# - Unity Hololens (UWP) 构建会生成 Standalone 构建不会产生的错误?

Python,QRCODE - 如何显示图像?

php - 图像和基于浏览器的图表的图表框架