精选优质文档-倾情为你奉上% Edit By :DTL%图片颜色均衡x_min=58;x_max=1439;y_min=1;y_max=853;valid_pix_cnt=0;%浅色区域像素点个数计数%原始图像I=imread(ini_p2.png);figure(1)imshow(I);sum_pix=(x_max-x_min+1)*(y_max-y_min+1);mean_R=sum(sum(I(y_min:y_max,x_min:x_max,1)/sum_pix;mean_G=sum(sum(I(y_min:y_max,x_min:x_max,2)/sum_pix;mean_B=sum(sum(I(y_min:y_max,x_min:x_max,3)/sum_pix;I(249:370,423:595,1)=mean_R-5;I(249:370,423:595,2)=mean_G-5;I(249:370,423:595,3)=mean_B-5;%分块均衡Lx=