SHARE
TWEET

Untitled

a guest Sep 18th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top