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

update LAB5

parent 2709bb3a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -138,15 +138,14 @@ def gaussian_filter(a, b, sigma):
    return g


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


if __name__ == '__main__':

    test_input = np.array([[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]])
+352 KiB

File added.

No diff preview for this file type.

−352 KiB

File deleted.

+2.75 MiB

File added.

No diff preview for this file type.

+2.75 MiB

File added.

No diff preview for this file type.

Loading