#include <opencv2/highgui/highgui.hpp>#include <opencv2/core/core.hpp>#include <vector>#include <iostream>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;//class Histgram1D//{//public://Histgram1D()//{//histsize[0] = 256;//hranges[0] = 0.0;//hranges[1] = 255.0;//ranges[0] = hranges;//channels[0] = 0;//by default,we look at channel 0//}//// Computes the 1D histogram//cv::MatND gethistogram(const Mat & image)//{//MatND hist;////compute histogram//calcHist(&image,//1,//histogram from 1 image only//channels,//the channel used//Mat(),//no mask is used//hist,//the resulting histogram//1,//it is a 1D histogram//histsize,//number of bins//ranges//pixel value range//);//return hist;//}////computes the 1D histogram and returns an image of it//Mat getHistogramImage(const Mat &image)//{//MatND hist = gethistogram(image);//compute histogram first//double maxVal = 0;//double minVal = 0;//minMaxLoc(hist,&minVal,&maxVal,0,0);//Mat histimg(histsize[0],histsize[0],CV_8U,Scalar(255));//image on which to display histogram//int hpt = static_cast<int>(0.9*histsize[0]);////draw a vertical line foe each bin//for (int h=0;h