szymcio10

wyszukiwanie wzorca

May 24th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.43 KB | None | 0 0
  1. close all;
  2. clear all;
  3.  
  4. img_1 = imread('literki.bmp');
  5. img_2 = imread('wzorA.bmp');
  6.  
  7. wzor_literki = fft2(rot90(img_1,2),256,256);
  8. wzor_wzor = fft2(rot90(img_2,2),256,256);
  9.  
  10. wzor_wynik = wzor_literki.*wzor_wzor;
  11.  
  12. odwr = ifft2(wzor_wynik);
  13. %odwr_s = ifftshift(odwr);
  14.  
  15. se = strel('square',3);
  16. xd = imtophat(odwr,se);
  17.  
  18. figure(1)
  19.  
  20. subplot(1,3,1)
  21. imshow(img_1)
  22.  
  23. subplot(1,3,2)
  24. imshow(img_2)
  25.  
  26. subplot(1,3,3)
  27. imshow(xd)
Advertisement
Add Comment
Please, Sign In to add comment