Question

Suppose we have number five from handwritten digit dataset. I want to rotate it 30 degrees (counter clockwise) then shift it 10 pixels vertical and horizontal. How should I do it?

Was it helpful?

Solution

Let I be your image.

%I = Input image;
J = imrotate(I,30); %To rotate
JS = [zeros(size(J,1),10), J]; %To shift 10pix horizontally 

figure,imshow(I)
figure,imshow(J)
figure,imshow(JS)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top