Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. imgorig = imread("image.png");
  2. img = rgb2gray(imgorig);
  3. x = length(img(:,1));
  4. y = length(img(1,:));
  5. for i=1:x
  6. for j=1:y
  7. zerone(i, j) = double(img(i, j))/25.5-5;
  8. imgf(i, j) = uint8(1/(1+exp(-zerone(i, j)))*255);
  9. endfor
  10. endfor
  11. subplot(1, 2, 1), imshow(img)
  12. subplot(1, 2, 2), imshow(imgf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement