I have a figure and I am trying to understand it in Matlab.
I = imread('frame.png');
x = I(:,:,1);
y = I(:,:,2);
z = I(:,:,3);
In the Matlab workspace, the size of I is 480x640x3. I assume that this means this image has a width and height of 480 and 640 respectively, and 3 channels consisting of Red, Green, Blue.
On the other hand, the size of x in the workspace is 480x640, y is 480x640 and z is 480x640.
I am confused as I thought I(:,:,1) means give me all the rows for the first column and so, the size of x in the workspace should have been 480x1 and not 480x640.
:. Also, the first dimension is height, the second one is width.I(:,:,1)means all rows and all columns, and the first element along the 3rd dimension.