fraczek95

Untitled

Jun 14th, 2019
545
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input_image = rgb2gray(imread("cotillard.jpg"));
  2.  
  3. imageWidth = size(input_image) (1)
  4. imageLenght = size(input_image) (2)
  5.  
  6. e = [];
  7. image = [];
  8. e(1) = input_image(1)(1)
  9. counter = 1;
  10.  
  11. %%%%% KODOWANIE %%%%%%%%
  12.  
  13. for i = 1 : imageWidth
  14.   for j = 1 : imageLenght
  15.     image(counter) = input_image(i,j);
  16.     counter++;
  17.     endfor
  18. endfor
  19.  
  20. for x = 1 : size(image)(2)
  21.   if (x == 1)
  22.     e(x) = image(1);
  23.   else
  24.     e(x) = image(x) - image(x-1);    
  25.   endif
  26. endfor
  27.  
  28. %%%%%% DEKODOWANIE %%%%%%%
  29.  
  30. g = [];
  31. out_image = uint8([]);
  32.  
  33. for x = 1 : size(image)(2)
  34.   if (x == 1)
  35.     g(x) = e(1);
  36.   else
  37.     g(x) = e(x) + g(x-1);
  38.   endif
  39. endfor
  40.  
  41. counter = 1;
  42.  
  43. for i = 1 : imageWidth
  44.   for j = 1 : imageLenght
  45.     out_image(i,j) = uint8(g(counter));
  46.     counter++;
  47.     endfor
  48. endfor
  49.  
  50.  
  51.  
  52. figure
  53. subplot(1,2,1)
  54. imshow(input_image)
  55. title ('Obraz wejsciowy');
  56. subplot(1,2,2)
  57. imshow(out_image)
  58. title ('Obraz wyjsciowy');
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×