Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. 1 wyswietlenie,przyciemnienie
  2. a = imread ('maki.jpg');
  3. figure (1);
  4. subplot(2,2,1);
  5. image(a);
  6. b = a;
  7. b=double(b);
  8. c= input ('Podaj wartosc przyciemnienia: ')
  9. b= b-c;
  10. subplot(2,2,2);
  11. b=uint8(b);
  12. image(b);
  13.  
  14. 2
  15. a= imread('maki.jpg');
  16. a= double(a);
  17. figure (1);
  18. subplot(2,2,1);
  19. a=uint8(a);
  20. image(a);
  21. b=a;
  22. r=b(:,:,1);
  23. g=b(:,:,2);
  24. b=b(:,:,3);
  25. b=0.299*r+0.587*g+0.114*b;
  26. subplot(2,2,2);
  27. image(b);
  28. czarno=0.299*r+0.587*g+0.114*b;
  29. czarno=uint8(czarno);
  30. [m,n]=size(czarno);
  31. p=80;
  32. for i=1:m
  33. for j=1:n
  34. if czarno(i,j)<=p
  35. czarno(i,j)=0;
  36. else
  37. end
  38. end
  39. end
  40. czarno(i,j)=255;
  41. colormap(gray(256));
  42. subplot(2,2,3);
  43. image(czarno);
  44.  
  45. 3 zmiana koloru
  46. close all;
  47. clear all;
  48. d=imread('maki.jpg');
  49. image(d);
  50. [y x] = ginput(1);
  51. x=floor(x);
  52. y=floor(y);
  53. punkt=d(y,x,:);
  54. figure(2);
  55. image(punkt);
  56.  
  57. 4
  58. clear all;
  59. img = imread('maki.jpg');
  60. kolum = size(img, 1);
  61. wiersz = size(img, 2);
  62.  
  63. img2 = zeros(kolum + 30, wiersz +30, 3);
  64. for i=1:kolum+30
  65. for j = 1:wiersz+30
  66. img2(i,j, 2) = 255;
  67. end
  68. end
  69.  
  70. for i = 16:kolum+15
  71. for j = 16:wiersz +15
  72. img2( i, j, :) = img(i-15, j-15, :);
  73. end
  74. end
  75. img2 = uint8(img2);
  76. figure(1);
  77. image(img2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement