Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I = imread('D:\lastsem\assignment1.jpg');
- figure;
- imshow(I);
- [row,col,color] = size(I);
- K = uint8(ones(row,col,color));
- a = 1;
- b = 1;
- c = 1;
- for i = 1:row
- for j = col:-1:1
- K(i,a,1)=I(i,j,1);
- a = a+1;
- end
- a=1;
- end
- for i = 1:row
- for j = col:-1:1
- K(i,b,2)=I(i,j,2);
- b = b+1;
- end
- b=1;
- end
- for i = 1:row
- for j = col:-1:1
- K(i,c,3)=I(i,j,3);
- c = c+1;
- end
- c=1;
- end
- figure;
- imshow(K);
- L = uint8(ones(row,2*col,color));
- for i= 1:row
- for j= 1:col
- L(i,j,1) = I(i,j,1);
- end
- end
- a=1;
- for i= 1:row
- for j= col+1:2*col
- L(i,j,1) = K(i,a,1);
- a=a+1;
- end
- a=1;
- end
- for i= 1:row
- for j= 1:col
- L(i,j,2) = I(i,j,2);
- end
- end
- a=1;
- for i= 1:row
- for j= col+1:2*col
- L(i,j,2) = K(i,a,2);
- a=a+1;
- end
- a=1;
- end
- for i= 1:row
- for j= 1:col
- L(i,j,3) = I(i,j,3);
- end
- end
- a=1;
- for i= 1:row
- for j= col+1:2*col
- L(i,j,3) = K(i,a,3);
- a=a+1;
- end
- a=1;
- end
- figure;
- imshow(L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement