图像增强
1 Mat ImageAHE(Mat img, int block) 2 { 3 Mat AHE_GO = img.clone(); 4 5 int width = img.cols; 6 int height = img.rows; 7 int width_block = width / block; //每个小格子的长和宽 8 int height_block = height / block; 9 //存储各个直方图 10 11 12 int tmp2[16 * 16][256] = { 0 };//10要和block保持一致 13 float C2[16 * 16][256] = { 0.0 }; 14 //分块 15 int total = width_block * height_block;//分割的总的块儿数 16 for (int i = 0; i < block; i++) 17 { 18 for (int j = 0; j < block; j++) 19 { 20 int start_x = i * width_block; 21 int end_x = start_x + width_block; 22 int start_y = j * height_block; 23 int end_y = start_y + height_block; 24 25