Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bassemhalim/webrtc-demo
webrtc demo using aiortc library
https://github.com/bassemhalim/webrtc-demo
numpy opencv python3 webrtc
Last synced: 19 days ago
JSON representation
webrtc demo using aiortc library
- Host: GitHub
- URL: https://github.com/bassemhalim/webrtc-demo
- Owner: BassemHalim
- Created: 2023-06-23T21:48:09.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-17T02:09:21.000Z (over 1 year ago)
- Last Synced: 2024-04-22T13:47:07.238Z (9 months ago)
- Topics: numpy, opencv, python3, webrtc
- Language: Python
- Homepage:
- Size: 25.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## WebRTC video Streaming and Position Estimation
This project demonstrates a simple implementation of a WebRTC-based video streaming and position estimation system using a server and client application.
![demo](bouncing-ball.gif)
## Overview
The server application (server.py) opens a WebRTC video stream of a bouncing ball. It generates frames with a ball animation and streams them to connected clients.
The client application (client.py) receives the video stream from the server and displays it. It then spawns a new process that estimates the position of the bouncing ball in each frame using computer vision techniques. The client then opens a data channel to the server and sends the estimated positions back through that channel
The server then computes and displays the error between the actual and the estimated ball positions
the webRTC logic was handled by the library "aiortc" and a TCPsocket was used for signaling
I tested 2 techniques to determine the ball position; the first was to to get the sum of each row/column and find the index of the max sum (argmax).
The second was using openCV Hough transform to find the centers. Both solutions had similar results however I opted for the openCV solution because the other solution assumes the ball is placed on a black background which would otherwise not find the correct solution.