The matrix from photo1.jpg is not square. We can, however, still apply matrices to shift the…

The matrix from photo1.jpg is not square. We can, however, still apply matrices to shift the pixels. Find a matrix that will perform a horizontal shift of 240 pixels to photo1.jpg and include the shifted image in your write up. Hint: We saw with n x n matrices that to perform a horizontal shift we multiply our matrix by a transformation matrix on the right. The transformation matrix on the right was obtained by transforming the columns of the n x n identity matrix in the same way we wanted the columns of the image matrix to be transformed. For a non-square matrix X, we can take the same approach, but we have to start with the correct identity matrix. Think about the dimensions of the matrix you want to transform and find the matrix In such that XIR X. Manipulate the columns of Ir to obtain the transformation matrix. Display your matrix using spy(). + T(r:1,:) = +1 whiteout.m imageshift.m * trans.m X 1 function shift = imageshift (x) 2 Y = x.^(-1) 3 – I = x.*Y 4 – [m, n] size (I) 5 – r = 240 6 – E = eye (n) 7- T = zeros (n) 8 9- shift = x.*T 10 – imagesc(uint8 (shift)) 11 – end CO

The matrix from photo1.jpg is not square. We can, however, still apply matrices to shift the pixels....