1 / 10

ROZ2 – cvičení 2

ROZ2 – cvičení 2. Image restoration - výsledky. Maska gaussiánu. function h = gauss(N, sigma) PI = 4*atan(1); npul = (N-1)/2; [x,y] = meshgrid(-1*npul:npul); h = 1/(2*PI*sigma^2) * exp(-1*(x.^2 + y.^2)/(2*sigma^2)); h = h / sum(h(:));. gauss(11,5) gauss(21,7). Poškození obrázku.

naiya
Télécharger la présentation

ROZ2 – cvičení 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ROZ2 – cvičení 2 Image restoration - výsledky

  2. Maska gaussiánu function h = gauss(N, sigma) PI = 4*atan(1); npul = (N-1)/2; [x,y] = meshgrid(-1*npul:npul); h = 1/(2*PI*sigma^2) * exp(-1*(x.^2 + y.^2)/(2*sigma^2)); h = h / sum(h(:)); gauss(11,5) gauss(21,7)

  3. Poškození obrázku function g = poskod(f, h, SNR) g1 = conv2(f, h); MinI = min(g1(:)); MaxI = max(g1(:)); var_f = var(f(:)); var_n = var_f / 10^(SNR / 10); g = g1 + var_n*randn(size(g1)); g(g<MinI) = MinI; g(g>MaxI) = MaxI;

  4. Výsledky gauss(11,3) gauss(21,7) BSNR 1/0 60 50

  5. Inverzní filtr SNR 200 150 function f = inverz(g, h) G = fft2(g); H = fft2(h, size(g,1), size(g,2)); F = G ./ H; f = ifft2(F); 120 130 140

  6. Wienerův filtr Gauss(11,3) SNR 60 function f = wiener(g, h, konst) G = fft2(g); H = fft2(h, size(g,1), size(g,2)); R = conj(H) ./ (abs(H).^2 + konst); F = R .* G; f = ifft2(F); konst 0,1 0,01 0,001 0,0001

  7. Rozmazání pohybem h = ones(1,10);

  8. Rozmazání pohybem m1 = log(abs(fft2(f).^2)); m2 = real(fft2(m1)); mi = min(m2(:)); m3 = m2 < 0.9*mi; m3 m1 fftshift+výřez

  9. Rozmazání defokusací h =kruh(20,10);

  10. Rozmazání defokusací m1 = log(abs(fft2(f).^2)); m2 = real(fft2(m1)); mi = min(m2(:)); m3 = m2 < 0.9*mi; fftshift(m3) fftshift(m1)

More Related