2014-04-21 68 views
0

嗨有人可以幫我關於此代碼,我知道它讀取圖像,並顯示RGB圖像(Fruits1)的直方圖上的紅色通道。MATLAB - 有人可以請只解釋這些代碼行

colourImage = imread('Fruits1.jpg');  //read image 
redHistogram = double(colourImage(:,:,1)); //what does this line do? 
figure, hist(redHistogram(:),124);   //what does this line do? 

回答

1
redHistogram = double(colourImage(:,:,1)); //what does this line do? 

這利用了圖像的紅色平面,並且每個像素強度從一個整數(0-255)轉換成浮點值(雙)。結果是這些值的二維數組。

figure, hist(redHistogram(:),124);   //what does this line do? 

這顯示了從上面的像素強度直方圖,分爲124個相同大小的箱子。

+0

非常感謝:) – SassyCoder

相關問題