如何创建直方图 [英] How to create a histogram

查看:398
本文介绍了如何创建直方图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个使用EMGU C#程序中的直方图。 EMGU包含在叫MCvHistogram类,但我不知道如何使用它。

I want to create a histogram within a C# program that uses EMGU. EMGU contains a class called MCvHistogram in it, but I don't know how to use it.

推荐答案

您应该使用DenseHistogram类如果你想使用EmguCV。
我会告诉你基本用法:

You should use DenseHistogram class if you want to use EmguCV. I'll show you basic usage:

  // 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类中其他常用的方法,如背投

There are a lot of other common methods inside DenseHistogram class such as Back Projection

这篇关于如何创建直方图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆