java - OpenCV: calcHist puts all results in the first bin -
i working on opencv 3.0 project in java, want detect percentage of yellow found in image. however, when calculate histogram of hue values, end histogram bins contain value 0.0 besides first bin. seems if contains observations. here extract image - since work opencv, hue value should in following range 0-179: //establish number of bins matofint histsize = new matofint(10); // set range value, upper bound exclusive // hue varies 0 179 matoffloat histrange = new matoffloat(0f, 180f); // histogram of hue value computed --> channel 0 == hue matofint channel = new matofint(0); mat histref= new mat(); arraylist<mat> histimages = new arraylist<mat>(); histimages.add(hsvroi); //definition: calchist(images, channels, mask, hist, histsize, ranges, accumulate) imgproc.calchist(histimages, channel, new mat(), histref, histsize, histrange); core.normalize(histref, h