Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input_image = rgb2gray(imread("cotillard.jpg"));
- imageWidth = size(input_image) (1)
- imageLenght = size(input_image) (2)
- e = [];
- image = [];
- image_buf =[];
- e(1) = input_image(1)(1)
- counter = 1;
- eta = 25;
- %%%%% KODOWANIE %%%%%%%%
- for i = 1 : imageWidth
- for j = 1 : imageLenght
- image(counter) = input_image(i,j);
- counter++;
- endfor
- endfor
- image_buf(1) = image(1);
- for x = 2 : size(image)(2)
- e(x) = image(x) - image_buf(x-1);
- if e(x) >= 0
- e(x) = eta;
- else
- e(x) = -eta;
- endif
- image_buf(x) = image_buf(x-1) + e(x);
- endfor
- %%%%%% DEKODOWANIE %%%%%%%
- out_image = uint8([]);
- counter = 1;
- for i = 1 : imageWidth
- for j = 1 : imageLenght
- out_image_e1(i,j) = uint8(image_buf(counter));
- counter++;
- endfor
- endfor
- figure
- subplot(1,2,1)
- imshow(input_image)
- subplot(1,2,2)
- imshow(out_image)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement