Matlab中將RGB圖片轉(zhuǎn)換成Lab空間的了,為什么用ims-ow函數(shù)顯示不出來圖片?代碼如下:% Transfer RGB to CIELab space% We only consider part c-annels (e.g., a and b) for one i-ge in L*a*b*% space.Lab = -kecform("srgb2lab");imgLab = applycform(img,Lab);figure("Name", "L*a*b* Space", "NumberTitle", "off"), ims-ow(imgLab);% Extract t-e i-ge in c-annel a* and b* respectively.imgLabC-AB = uint8(imgLab(:,:,2:3));%figure("Name", "Temp C-annel a* and b*", "NumberTitle", "off"), ims-ow(imgLabC-AB);rowC-AB = size(imgLabC-AB,1);colC-AB = size(imgLabC-AB,2);imgLabC-AB = res-ape(imgLabC-AB,rowC-AB,colC-AB, 2);figure("Name", "C-annel a* and b*", "NumberTitle", "off"), ims-ow(imgLabC-AB);1 個答案
答案 1:
首先簡單說下ims-ow。如果ims-ow(A)這樣一個用法,那么A可以是1維矩陣或者3維矩陣。>
當(dāng)1維矩陣時,顯示的是灰度或二值圖像;
當(dāng)3維矩陣時,顯示的是彩-像,并默認(rèn)三個維分別依次對應(yīng)R、G、B三個通道。