List of usage examples for org.opencv.core Core normalize
public static void normalize(Mat src, Mat dst)
From source file:gab.opencv.OpenCV.java
License:Open Source License
public Histogram findHistogram(Mat mat, int numBins, boolean normalize) { MatOfInt channels = new MatOfInt(0); MatOfInt histSize = new MatOfInt(numBins); float[] r = { 0f, 256f }; MatOfFloat ranges = new MatOfFloat(r); Mat hist = new Mat(); ArrayList<Mat> images = new ArrayList<Mat>(); images.add(mat);// w w w . j a v a 2 s . c om Imgproc.calcHist(images, channels, new Mat(), hist, histSize, ranges); if (normalize) { Core.normalize(hist, hist); } return new Histogram(parent, hist); }