I don't understand the Icolored(:,:,1/2/3).
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Nitin
le 21 Juin 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Red dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!