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

조회 수: 2 (최근 30일)
Shaila parvin
Shaila parvin 2013년 6월 21일
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