Reputation: 45
In a MATLAB code, I have got an image called myImage
. What is the image Output
equal to?
The image myImage
as a double
2dim matrix.
Output = [ myimage(:,1) myimage(:,1:size(myimage,2)-1) ];
I only understand that the first column of the image Output
"image(:,1)
" is the first column of the image myImage
. But what is the second? Actually, what is the myimage(: , 1: anumber);
?
Upvotes: 1
Views: 144
Reputation: 112659
It's the original image with the last column removed and the first column duplicated.
Note that
myimage(:, 1:anumber)
means columns 1
,...,anumber
of myimage
. See Matlab colon operator.size(myimage,2)
is the number of columns of myimage
. See size
documentation.An example shows the result:
>> myimage = magic(4)
myimage =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> Output = [ myimage(:,1) myimage(:,1:size(myimage,2)-1) ]
Output =
16 16 2 3
5 5 11 10
9 9 7 6
4 4 14 15
Upvotes: 1