|
http://www.cnblogs.com/ggYYa/p/5707259.html
- //求各通道的平均值
- 25 imageBlueChannelAvg = mean(imageBlueChannel)[0];
- 26 imageGreenChannelAvg = mean(imageGreenChannel)[0];
- 27 imageRedChannelAvg = mean(imageRedChannel)[0];
- 28
- 29 //求出个通道所占增益
- 30 double K = (imageRedChannelAvg+imageGreenChannelAvg+imageRedChannelAvg)/3;
- 31 double Kb = K/imageBlueChannelAvg;
- 32 double Kg = K/imageGreenChannelAvg;
- 33 double Kr = K/imageRedChannelAvg;
- 34
- 35 //更新白平衡后的各通道BGR值
- 36 addWeighted(imageBlueChannel,Kb,0,0,0,imageBlueChannel);
- 37 addWeighted(imageGreenChannel,Kg,0,0,0,imageGreenChannel);
- 38 addWeighted(imageRedChannel,Kr,0,0,0,imageRedChannel);
复制代码 |
|