2014-04-21 52 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

相关问题