I don't understand the Icolored(:,:,1/2/3).

2 次查看(过去 30 天)
Please help me to understand the 3 lines of this code:
function [F]=get_image_features(Icolored) %Icolored is the image coming from the line F=get_image_features(I); from create_learning_set.m file
%%get R G B components of the sub-image
R = Icolored(:,:,1);
G = Icolored(:,:,2);
B = Icolored(:,:,3);
%%Get random 128 x 128 sub-image
% R=rnad_subimage(R);
% G=rnad_subimage(G);
% B=rnad_subimage(B);
%%get the features of each channel
Rf=get_channel_features(R);
Gf=get_channel_features(G);
Bf=get_channel_features(B);
%the feature vector
F=[Rf Gf Bf];
end
These 3 line are:
R = Icolored(:,:,1);
G = Icolored(:,:,2);
B = Icolored(:,:,3);

采纳的回答

Nitin
Nitin 2013-6-21
Coloured images are basically made up of Red, Green and Blue channels. Each colour code is stored in a given dimension and what you see is the combination of the three. What these three lines are essentially doing is giving you the option to see them in their individual colour code, R,G & B.
This post should make things clearer, http://www.mathworks.com.au/matlabcentral/answers/19083

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by