Using OpenCV, SMPT messaging, and FFmpeg we have successfully made a system that can monitor who is in a room. The BeaglePlay is set up to continually upload to a Twitch livestream with the camera feed using FFmpeg. During the script, every two minutes (customizable), a frame will be captured and will run through some image processing to be fed to the OpenCV HOG person detector. If a person is detected in the image, using SMPT, a message will be sent to the designated phone number that there may be an individual in the room. It will also email a picture of the room at the time a person was detected.
Installation Instructions: If the BeaglePlay is being used, download an image to flash to the eMMC from here. A convenient and brief guide to flashing the eMMC.
- The repository containing all the code necessary.
- install.sh ensures that pip and opencv is installed, the other libraries are standard. systemd.sh enables the entrycam.service systemd service so that the program can always run on boot. Ensure that the paths are correct for the cloned distribution of the code. run.sh will run the program manually (entrycam.py).
- The BeaglePlay needs to be connected to the network in some way, we went with an ethernet cable for simplicity.
Once all the instructions from above are followed, the entrycam.service should be enabled as a systemd service to run at boot. It runs entrycam.py which is the main script to run.
There are two major modifications that needs to be made to entrycam.py and messaging.py: In entrycam.py, The stream key for the Twitch livestream must be changed to your own personal key in order for it to be correctly accessed. It can be found under settings in the creator dashboard in your twitch account. It is possible to use the current stream key, but it is only linked to one account. If using this, the livestream can be found by searching for apartment4022 on twitch.
In messaging.py, Change the phone number in the receiver line to the personal phone number.
After this is done and the systemd service is activated, as long as the Beagle is connected to internet (we chose through ethernet), the programs should run when the Beagle boots up. It make take a minute or so for the stream to appear. It lags a fair amount, but given the maximum power we could achieve with the BeaglePlay, the stream should run at 15-20 FPS. This would be suitable enough for an individual to check if there is a person in the area.
Below are images we captured of the email service and stream:
Further breakdown can be found at: https://elinux.org/ECE434_Project_-_IOT_Entry_Way_Camera


_ox0H4uABdL.png?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)


Comments