常見的應用為 RGB → HSV → Histogram → RGB;
在這階段性處理過程中,H (Hue) 容易受光影所影響,
故我們針對 RGB 影像使用白平衡處理。
(原圖)
(白平衡處理)
上下兩圖分別為原圖及經過處理後,
可以明顯發先到原圖色調較濃但略偏黃綠色,經過白平衡後亮度較暗,色調較為均勻。
也因此,經過此道手續後常需另外做處理以達最佳顯示效果。
※ 下回會針對 RGB → HSV → Histogram → RGB 做一完整介紹。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
close all,clear; | |
img=imread('$PATH'); | |
figure, image(img), axis off | |
red=img(:,:,1); | |
green=img(:,:,2); | |
blue=img(:,:,3); | |
[m,n]=size(red); | |
RED=mean(mean(red)); | |
GREEN=mean(mean(green)); | |
BLUE=mean(mean(blue)); | |
AVE=(RED+GREEN+BLUE)/3; | |
red=(AVE/RED)*red; | |
green=(AVE/GREEN)*green; | |
blue=(AVE/BLUE)*blue; | |
balance=cat(3,red,green,blue); | |
figure, image(balance), axis off |
No comments:
Post a Comment