That said, we didn’t get far enough into the setup to actually test them out—and honestly, we kind of knew from the start that it might not be worth the effort. Blobby doesn’t need high image quality, and we don’t have the processing power to handle those camera streams anyway. We ended the day with a sentiment of having given it a good try and realized just how much easier using standard plug in webcams could be. It might potentially require more than one computer to use six of them at once, but even that set up would be easier than trying to configure six IP ones.
WebcamController, which creates a Webcam class for each webcam, and manages them. The WebcamController uses threading to ensure that all the Webcam‘s get approximately the same amount of computing time. To test out my code, I built out the WebSocket server logic.I created a separate JavaScript file for the WebSocket server. The actual code was relatively simple. The server takes in messages from the Python
WebcamController class, and then forwards them to the blobby website. On the Python side, there’s a websocket packageWebcamController to contain two main pieces of information. First, the index of the webcam it is reporting from, and second, a list of points that defines the shape of the blob. I then added a method inside the blobby server code to draw the shape of the curve, and fill it in. I connected two additional webcams to my laptop (so three in total), and tested out the code. Since I pointed all the webcams at myself, the blobs look like copies of each other, but they are actually three separate webcams reporting to the same webpage. Success!