Skip to content

Commit 7ed4d18

Browse files
committed
complete
1 parent f3a0477 commit 7ed4d18

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ def encodeData(frame, center=None, quality=90):
295295
# Create data dictionary
296296
data = {
297297
'frame': frame_bytes_b64,
298-
'x': x_coord,
299-
'y': y_coord
298+
'image_x': x_coord,
299+
'image_y': y_coord,
300+
'isball': bool(x_coord and y_coord),
300301
}
301302

302303
# Serialize dictionary to JSON string
@@ -370,6 +371,7 @@ def main():
370371

371372
# Prepare frame for encoding (resize)
372373
frame_resized = cv2.resize(frame, (output_width, output_height), interpolation=cv2.INTER_AREA)
374+
#print(center)
373375

374376
# Encode data (resized frame and center coordinates)
375377
encoded_json_string = Encoder.encodeData(frame_resized, center, quality=jpeg_quality)

receive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func ReceiveData(chclient chan bool, MyID uint32, ip string) {
178178
CheckError(err)
179179
defer serverConn.Close()
180180

181-
buf := make([]byte, 10240)
181+
buf := make([]byte, 20240)
182182
for {
183183
n, _, _ := serverConn.ReadFromUDP(buf)
184184

0 commit comments

Comments
 (0)