Commit 40021122 authored by 袁通's avatar 袁通
Browse files

Update lab5

parent bf2bebf2
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -131,7 +131,17 @@ def gaussian_filter(a, b, sigma):
    return g
    return g




def butterworth_filter(b, a, n, sigma):
    x, y = np.meshgrid(np.linspace(0, a - 1, a), np.linspace(0, b - 1, b))
    print(x)
    x = x - a / 2
    y = y - b / 2
    d = np.sqrt(x * x + y * y)
    h = 1/(1+(d/sigma)**(2*n))
    return h


if __name__ == '__main__':
if __name__ == '__main__':


    io.imsave("gaussian_filter_test.tif", format_image(gaussian_filter(100, 100, 30)))
    io.imsave("butterworth_filter_test.tif", format_image(butterworth_filter(100, 100, 2, 30)))
+1.81 MiB

File added.

No diff preview for this file type.

+40.6 KiB

File added.

No diff preview for this file type.

+40.6 KiB

File added.

No diff preview for this file type.

+40.6 KiB

File added.

No diff preview for this file type.

Loading