Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

See the OpenCV tutorials for some Java code, example here.

In Java, you have to retrieve the whole buffer, something like:

    float[] bHistData = new float[(int) (bHist.total() * bHist.channels())];
    bHist.get(0, 0, bHistData);

To iterative over a HxWxC stored as a 1D-buffer, it should be something like this (pseudo-code):

for (int i = 0; i < H; i++)
{
    for (int j = 0; j < W; j++)
    {
        for (int c = 0; c < C; c++)
        {
            buf[i*W*C + j*C + c] = 0;
        }
    }
}