RH1212354
RH1212354

Reputation: 17

Extracting RGB color histogram for an image using C# and EmguCV

I am trying to extract RGB color Histogram for an image using C# (or C++) and Emgu CV. Current:

static double[] colorHistogram(Image<Bgr, Byte> img, int rStep, int gStep, int bStep)
{
     double[] histogram = null;
     return histogram;
}

Upvotes: 0

Views: 1189

Answers (1)

Yuchen
Yuchen

Reputation: 33036

No need to reinvent the wheel. Use the already available function CalcHist in EmguCV!

C#:

public static void CalcHist(
    IInputArray images,
    int[] channels,
    IInputArray mask,
    IOutputArray hist,
    int[] histSize,
    float[] ranges,
    bool accumulate
)

C++:

public:
static void CalcHist(
    IInputArray^ images, 
    array<int>^ channels, 
    IInputArray^ mask, 
    IOutputArray^ hist, 
    array<int>^ histSize, 
    array<float>^ ranges, 
    bool accumulate
)

There you go!

Upvotes: 3

Related Questions