From 2699913e92e3ce54d41ed5b4d7636c07fadd65f2 Mon Sep 17 00:00:00 2001 From: yair Date: Fri, 14 Nov 2025 16:29:31 +0200 Subject: [PATCH] rolling --- network_guide.md | 29 +++++++++++++++++++---------- scripts/recv_raw_rolling.py | 13 ++++++++----- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/network_guide.md b/network_guide.md index 1850401..2d91c5e 100644 --- a/network_guide.md +++ b/network_guide.md @@ -1,5 +1,24 @@ # how to send a line +real data +```powershell +gst-launch-1.0 idsueyesrc config-file=ini/200fps-2456x4pix-cw.ini exposure=5 framerate=300 ` + ! videoconvert ! queue ` + ! udpsink host=127.0.0.1 port=5000 +``` + +### Python/OpenCV Receiver +```pwsh +uv run scripts/recv_raw_column.py +``` +or rolling like +```pwsh +uv run .\scripts\recv_raw_rolling.py +``` +See [`scripts/recv_raw_column.py`](scripts/recv_raw_column.py) for the Python implementation with debug options. + + +# demo data ## Sender (crop to first column, send raw over UDP) ```pwsh gst-launch-1.0 -v ` @@ -9,10 +28,6 @@ gst-launch-1.0 -v ` udpsink host=127.0.0.1 port=5000 ``` -**Note:** Default `videotestsrc` height is 640, not 480. Adjust caps to match your actual frame size. - -## Receiver Options - ### GStreamer Receiver (raw UDP → display) ```pwsh gst-launch-1.0 -v ` @@ -21,9 +36,3 @@ gst-launch-1.0 -v ` autovideosink ``` -### Python/OpenCV Receiver -```pwsh -uv run scripts/recv_raw_column.py -``` - -See [`scripts/recv_raw_column.py`](scripts/recv_raw_column.py) for the Python implementation with debug options. \ No newline at end of file diff --git a/scripts/recv_raw_rolling.py b/scripts/recv_raw_rolling.py index 4efe972..686d065 100644 --- a/scripts/recv_raw_rolling.py +++ b/scripts/recv_raw_rolling.py @@ -64,15 +64,18 @@ while True: # Apply rotation if configured if ROTATION is not None: - column = cv2.rotate(frame, ROTATION) + rotated = cv2.rotate(frame, ROTATION) else: - column = frame + rotated = frame + + # Extract only the first column for smoother rolling (1 pixel/frame) + column = rotated[:, 0:1, :] - # Insert the column into the rolling buffer at the current position - rolling_buffer[:, current_column:current_column+COLUMN_WIDTH, :] = column + # Insert the single column into the rolling buffer at the current position + rolling_buffer[:, current_column:current_column+1, :] = column # Move to the next column position, wrapping around when reaching the end - current_column = (current_column + COLUMN_WIDTH) % DISPLAY_WIDTH + current_column = (current_column + 1) % DISPLAY_WIDTH # Display the rolling buffer cv2.imshow("Rolling Column Stream", rolling_buffer)