Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

c# - How to create a histogram

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...