This commit is contained in:
2025-01-31 20:38:27 -06:00
parent 50128ac4a6
commit 275e5eec3e
3 changed files with 38 additions and 20 deletions

View File

@ -1,6 +1,9 @@
import cv2
import socket
import numpy as np
import uuid
uuid = uuid.uuid4()
from common import StdPacket, InterlacedPacket
@ -26,7 +29,7 @@ def breakdown_image_norm(frame):
for i in range(0, cols, 16):
for j in range(0, rows, 16):
# print("Sending frame segment (%d, %d)", i, j)
pkt = StdPacket(j, i, frame[i:i + 16, j:j + 16])
pkt = StdPacket(uuid, j, i, frame[i:i + 16, j:j + 16])
send_packet(sock, pkt.to_bytestr())
def breakdown_image_interlaced(frame):
@ -36,13 +39,13 @@ def breakdown_image_interlaced(frame):
for i in range(0, cols, 32):
for j in range(0, rows, 16):
# print("Sending frame segment (%d, %d)", i, j)
pkt = InterlacedPacket(j, i, False, frame[i:i + 32:2, j:j + 16])
pkt = InterlacedPacket(uuid, j, i, False, frame[i:i + 32:2, j:j + 16])
send_packet(sock, pkt.to_bytestr())
for i in range(0, cols, 32):
for j in range(0, rows, 16):
# print("Sending frame segment (%d, %d)", i, j)
pkt = InterlacedPacket(j, i, True, frame[i + 1:i + 32:2, j:j + 16])
pkt = InterlacedPacket(uuid, j, i, True, frame[i + 1:i + 32:2, j:j + 16])
send_packet(sock, pkt.to_bytestr())
while True: