int histo[256] = { 0 };//直方图统计每个像素值的数目 int width = img.cols, height = img.rows; int num_of_pixels = width*height; //统计每个像素值的数目 for (int y = 0; y < height; ++y) { auto *data = new uchar[width * height * 3]; for (int x = 0; x < width; ++x) { histo[dat…