diff --git a/client.py b/client.py index bc1a24e..435fb23 100644 --- a/client.py +++ b/client.py @@ -20,7 +20,7 @@ def breakdown_image_norm(frame, last_frame): arr = frame[i:i + 16, j:j + 16] last_arr = last_frame[i:i + 16, j:j + 16] # only update if image segments are different - if not np.array_equal(arr, last_arr): + if not np.allclose(arr, last_arr): pkt = StdPacket(uuid, j, i, arr) send_packet(sock, pkt.to_bytestr()) @@ -33,7 +33,7 @@ def breakdown_image_interlaced(frame, last_frame): # print("Sending frame segment (%d, %d)", i, j) arr = frame[i:i + 32:2, j:j + 16] last_arr = last_frame[i:i + 32:2, j:j + 16] - if not np.array_equal(arr, last_arr): + if not np.allclose(arr, last_arr): pkt = InterlacedPacket(uuid, j, i, False, arr) send_packet(sock, pkt.to_bytestr()) @@ -43,7 +43,7 @@ def breakdown_image_interlaced(frame, last_frame): arr = frame[i + 1:i + 32:2, j:j + 16] last_arr = last_frame[i + 1:i + 32:2, j:j + 16] # only update if image segments are different - if not np.array_equal(arr, last_arr): + if not np.allclose(arr, last_arr): pkt = InterlacedPacket(uuid, j, i, True, arr) send_packet(sock, pkt.to_bytestr()) @@ -62,7 +62,7 @@ def breakdown_image_dint(frame, last_frame): arr = frame[i + i_even:i + 32:2, j + j_even:j + 32:2] last_arr = last_frame[i + i_even:i + 32:2, j + j_even:j + 32:2] # only update if image segments are different - if not np.array_equal(arr, last_arr): + if not np.allclose(arr, last_arr): pkt = DoublyInterlacedPacket(uuid, j, i, j_even, i_even, arr) send_packet(sock, pkt.to_bytestr())