Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ZAD 1
  2.  
  3. img=csvread("punktman_n.csv");
  4. mac=img';
  5. mac(3,:)=1;
  6. tx=1;
  7. ty=-0.5;
  8. sx=1;
  9. sy=0.5;
  10. obr=pi/2;
  11. przesun=[1,0,tx;0,1,ty;0,0,1];
  12. skalowanie=[sx,0,0;0,sy,0;0,0,1];
  13. obrot=[cos(obr),-sin(obr),0;sin(obr),cos(obr),0;0,0,1];
  14. mac=przesun*skalowanie*obrot*mac;
  15. subplot(1,2,1);
  16. plot(img(:,1),img(:,2),'sk');
  17. title("przed");
  18. xlabel("x pierwsza kolumna");
  19. ylabel("y druga kolumna");
  20. axis([-1 2 -1 1]);
  21. subplot(1,2,2);
  22. plot(mac(1,:),mac(2,:),'sk');
  23. title("po");
  24. xlabel("x pierwsza kolumna");
  25. ylabel("y druga kolumna");
  26. axis([-1 2 -1 1]);
  27.  
  28.  
  29. ZAD 2
  30.  
  31. clear
  32. img_org=double(imread("rzeczka.jpg"));
  33. [rn,gn,bn]=kol_zad_6(img_org(:,:,1),img_org(:,:,2),img_org(:,:,3));
  34. img_out(:,:,1)=rn;
  35. img_out(:,:,2)=gn;
  36. img_out(:,:,3)=bn;
  37. imshow(img_out/255);
  38.  
  39.  
  40. do zad 2
  41.  
  42. function [Rn,Gn,Bn] = kol_zad_6(R,G,B)
  43. K=0.25*R+0.5*G+0.25*B;
  44. L=0.5*R-0.5*B;
  45. M=-0.25*R+0.5*G-0.25*B;
  46. K=0.5*K;
  47. Rn=K+L-M;
  48. Gn=K+M;
  49. Bn=K-L-M;
  50. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement