简体   繁体   中英

The Matrices Variable of Image for Enhance Contrast in Matlab

i have a code like this :

i=imread('c.jpg'); %create variable
i=im2double(i); %convert i's value from uint8 into double
figure; %create new window
imshow(i, 'Border', 'tight'); %display image into window

ir=i(:,:,1); %what is '1' for?
ir=histeq(ir); %enhance it's contrast
figure; %create new window
imshow(ir, 'Border', 'tight'); %display image into window

ig=i(:,:,2); %what is '2' for?
ig=histeq(ig); 
figure;
imshow(ig, 'Border', 'tight');

ib=i(:,:,3); %what is '3' for?
ib=histeq(ib);
figure;
imshow(ib, 'Border', 'tight'); 

Igab = cat(3, ir, ig, ib); % combine 3 pics become 1 pic
figure; 
imshow(Igab,'Border','tight');

My question is, what is '1' or '2' or '3' for in i(:,:,1) ?

I just khow it is a matrix of image's values in the Matlab's Workspace. And i know the meaning of i(:,:) is an 'i' matrix with all row, all column. But what if i(:,:,1) ?

I am newbie.

Any help would be appreciated.

1 is for Red

2 is for Green

3 is for Blue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM