Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ZAD 1
- img=csvread("punktman_n.csv");
- mac=img';
- mac(3,:)=1;
- tx=1;
- ty=-0.5;
- sx=1;
- sy=0.5;
- obr=pi/2;
- przesun=[1,0,tx;0,1,ty;0,0,1];
- skalowanie=[sx,0,0;0,sy,0;0,0,1];
- obrot=[cos(obr),-sin(obr),0;sin(obr),cos(obr),0;0,0,1];
- mac=przesun*skalowanie*obrot*mac;
- subplot(1,2,1);
- plot(img(:,1),img(:,2),'sk');
- title("przed");
- xlabel("x pierwsza kolumna");
- ylabel("y druga kolumna");
- axis([-1 2 -1 1]);
- subplot(1,2,2);
- plot(mac(1,:),mac(2,:),'sk');
- title("po");
- xlabel("x pierwsza kolumna");
- ylabel("y druga kolumna");
- axis([-1 2 -1 1]);
- ZAD 2
- clear
- img_org=double(imread("rzeczka.jpg"));
- [rn,gn,bn]=kol_zad_6(img_org(:,:,1),img_org(:,:,2),img_org(:,:,3));
- img_out(:,:,1)=rn;
- img_out(:,:,2)=gn;
- img_out(:,:,3)=bn;
- imshow(img_out/255);
- do zad 2
- function [Rn,Gn,Bn] = kol_zad_6(R,G,B)
- K=0.25*R+0.5*G+0.25*B;
- L=0.5*R-0.5*B;
- M=-0.25*R+0.5*G-0.25*B;
- K=0.5*K;
- Rn=K+L-M;
- Gn=K+M;
- Bn=K-L-M;
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement