user3213352
user3213352

Reputation: 45

image shift operation

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

Answers (1)

Luis Mendo
Luis Mendo

Reputation: 112659

It's the original image with the last column removed and the first column duplicated.

Note that

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

Related Questions