Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.63 KB | None | 0 0
  1. clear all;
  2.  
  3. lena = imread('lena.tiff');
  4. lena_gray = rgb2gray(lena);
  5. lena_gray_normalized = double(lena_gray) / 255;
  6.  
  7. imshow(lena_gray);
  8. title('Original Lena Gray');
  9.  
  10. h1 = (1/6)*ones(1,6);
  11. h2 = h1';
  12. h3 = [-1 1];
  13.  
  14. lena_gray_convolved_h1 = conv2(lena_gray_normalized, h1);
  15. lena_gray_convolved_h2 = conv2(lena_gray_normalized, h2);
  16. lena_gray_convolved_h3 = conv2(lena_gray_normalized, h3);
  17.  
  18. figure
  19. imshow(lena_gray_convolved_h1);
  20. title('Lena Gray Convolved with h1');
  21. figure;
  22. imshow(lena_gray_convolved_h2);
  23. title('Lena Gray Convolved with h2');
  24. figure;
  25. imshow(lena_gray_convolved_h3);
  26. title('Lena Gray Convolved with h3');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement