I found a similar question: creating histogram using emgu cv c#
and it works well when i passed grayscaled images, but when i use the Matrix, program throws exceptions. my code:
Matrix<double> mat = new Matrix<double>(10, 10);
mat.SetRandUniform(new MCvScalar(0.0), new MCvScalar(20.0));
DenseHistogram histo = new DenseHistogram(5, new RangeF(0.0f, 20.0f));
histo.Calculate(new Matrix<double>[] { mat }, false, null);//<--throws exception here
CvInvoke.cvShowImage("Mat Histogram", histo.GetHistogramImage().Ptr);
CvInvoke.cvWaitKey(0);
and the declaration in emgu doc is:
public void Calculate<TDepth>(
Matrix<TDepth>[] matrices,
bool accumulate,
Matrix<byte> mask
)
where TDepth : new()
i cant figure out what's wrong :(