I don't understand the Icolored(:,:,1/2/3).
2 views (last 30 days)
Show older comments
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);
0 Comments
Accepted Answer
Nitin
on 21 Jun 2013
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Red in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!