matlab练习程序(白平衡)

clear all;
close all;
clc;

img=imread('Lena_cai.jpg');
imshow(img);

mean1=mean(mean(img(:,:,1)));
mean2=mean(mean(img(:,:,2)));
mean3=mean(mean(img(:,:,3)));

me=mean(mean(mean(img)));

img(:,:,1)=me/mean1*img(:,:,1);
img(:,:,2)=me/mean2*img(:,:,2);
img(:,:,3)=me/mean3*img(:,:,3);

figure,imshow(img);

参考:

http://www.ilovematlab.cn/thread-109633-1-1.html

转载于:https://www.cnblogs.com/tiandsp/archive/2012/04/29/2476227.html

你可能感兴趣的:(matlab练习程序(白平衡))