This project showcases how to use a Raspberry Pi and a computer on the same local network to generate random numbers based on the blobs of a lava lamp.
- A Raspberry Pi with a camera module
- A computer running on the same network as the Raspberry Pi
- Python 3.x installed on both devices
- OpenCV installed on the computer
pip install picamera2
pip install opencv-python
Run the following Python script on your Raspberry Pi to stream video from the camera module. The script sets up an HTTP server to serve the MJPEG stream.
Run the provided Python script on your computer to connect to the Raspberry Pi's video stream, process the video frames, and generate random numbers based on the lava lamp's visuals.
- Ensure both the Raspberry Pi and the computer are connected to the same local network.
- Run the Raspberry Pi script first to start the video stream.
- Run the computer script to connect to the video stream and process the frames.
- The computer script will display the video frames, process them, and generate random numbers.
- The Raspberry Pi script will print the IP address of the device. Use this IP address in the computer script to connect to the video stream.
- The computer script uses OpenCV to process the video frames, so make sure OpenCV is installed.