Getting dominant colour value from HSV Histogram
I am creating a hsv histogram from an image like below. - (void)processImageWithHsv:(Mat&)image; { Mat image_hsv; cvtColor(image, image_hsv, CV_BGR2HSV); int hbins = 50, sbins = 60; int histSize[] = {hbins, sbins}; float hranges[] = { 0, 360 }; float sranges[] = { 0, 256 }; const float* ranges[] = { hranges, sranges }; MatND hist; int channels[] = {0, 1}; calcHist( &image_hsv, 1, channels, Mat(), // do not use mask hist, 2, histSize, ranges, true, // the histogram is uniform false ); double maxVal = 0; minMaxLoc(hist, 0, &maxVal, 0, 0); // ???: HOW Convert this information to colour value }