Advertisement
Rementai

LAB01

Oct 5th, 2022
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.73 KB | None | 0 0
  1. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. WSTĘP
  3. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. clc
  5. clear all
  6. close all
  7.  
  8. imfinfo('lena.jpg');
  9. imfinfo('lena.bmp');
  10.  
  11. jpg = imread('lena.jpg');
  12. bmp = imread('lena.bmp');
  13.  
  14. figure(1)
  15. imshow(jpg)
  16.  
  17. figure(2)
  18. imshow(bmp)
  19.  
  20. figure(3)
  21. newmap = rgb2gray(jpg)
  22. imshow(newmap)
  23.  
  24. imwrite(newmap,'lena_gray.bmp');
  25.  
  26. figure(4)
  27. colormap gray
  28. mesh(newmap)
  29.  
  30. figure(5);
  31. plot(bmp(10,: ))
  32.  
  33. figure(6);
  34. plot(bmp(:,10 ))
  35.  
  36. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  37. OBRAZY INDEKSOWANE
  38. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  39.  
  40. clc
  41. clear all;
  42. close all;
  43.  
  44. lena = imread('lena_gray.bmp');
  45.  
  46. [X, map] = gray2ind(lena, 256);
  47.  
  48. figure(1)
  49. imshow(X, map);
  50. colormap turbo;
  51.  
  52. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  53. SYSTEMY (MODELE) BARW
  54. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  55.  
  56. clc
  57. clear all
  58. close all
  59.  
  60. lena = imread('lena.bmp');
  61.  
  62. R = lena(:,:,1); G = lena(:,:,2); B = lena(:,:,3);
  63. figure(1);
  64. subplot(2,2,1);
  65. imshow(lena);
  66. title('Oryginal');
  67. subplot(2,2,2);
  68. imshow(R);
  69. title('R');
  70. subplot(2,2,3);
  71. imshow(G);
  72. title('G');
  73. subplot(2,2,4);
  74. imshow(B);
  75. title('B');
  76.  
  77. lenahsv = rgb2hsv(lena);
  78. R = lenahsv(:,:,1); G = lenahsv(:,:,2); B = lenahsv(:,:,3);
  79. figure(2);
  80. subplot(2,2,1);
  81. imshow(lenahsv);
  82. title('Oryginal');
  83. subplot(2,2,2);
  84. imshow(R);
  85. title('R');
  86. subplot(2,2,3);
  87. imshow(G);
  88. title('G');
  89. subplot(2,2,4);
  90. imshow(B);
  91. title('B');
  92.  
  93. lenaycbcr = rgb2ycbcr(lena);
  94. R = lenaycbcr(:,:,1); G = lenaycbcr(:,:,2); B = lenaycbcr(:,:,3);
  95. figure(3);
  96. subplot(2,2,1);
  97. imshow(lenaycbcr);
  98. title('Oryginal');
  99. subplot(2,2,2);
  100. imshow(R);
  101. title('R');
  102. subplot(2,2,3);
  103. imshow(G);
  104. title('G');
  105. subplot(2,2,4);
  106. imshow(B);
  107. title('B');
  108.  
Tags: PoC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement