Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to compute 3D histogram for RGB image

Since java opencv Mat don't support 3D Mat elements, I wonder if i calculated Histogram for R channel , Histogram for G channel and Histogram for B channel and appended all the outputs together would it be the same if i calculated 3D histogram this way

    Mat histogram = new Mat();              
    MatOfInt histSizes = new MatOfInt(10,10,10);        
    MatOfFloat histRanges = new MatOfFloat(0,256,0,256,0,256);  
    MatOfInt channels = new MatOfInt(0,1,2);
    Imgproc.calcHist(sourceImages,channels,new Mat(), histogram, histSizes, histRanges);