Detecting Room Occupancy with Pi Camera Final Report Muneeb Alvi
Original Goal Python OpenCV Open Source Computer Vision Library
What I completed Went from using image differencing to being able to detect occupants individually in images Able to process images in real time Able to take previously taken images and identify occupants
Methods used OpenCV library HOG – Histogram of Oriented Gradients Popular Open Source Computer Vision Library Contains HOG and Linear SVM methods HOG – Histogram of Oriented Gradients Used for object detection in computer vision (detecting humans) Linear SVM methods Machine learning linear support vector machine methods Used for classification (person vs another object)
Components Hardware Send unprocessed image Process image and identify people Captures images which are processed by raspberry pi cpu
Components Software Python for interacting with camera and processing image Java for SIS server (simulate sending emails/alerts) Interact through file reading/writing Python writes occupancy status to file Java reads occupancy status and sends message to alert component Producer/Consumer model
Components Software Python Image processing program Alert Component Java SIS Server Alert Component Send occupancy status (occupied/empty) and number of occupants after processing image Forward message from Python program to any registered components Message Display corresponding Alert on Monitor Action
Remaining Challenges Current implementation is not 100% accurate Cannot detect all occupants Solution: Use better algorithm or a better camera Raspberry pi has computing limitations Takes longer than expected to process images Solution: Use better/more expensive hardware or optimize algorithm
Demo https://youtu.be/j9KoGBnrmV4