2016-05-15 14:33:37 -0600 | commented question | Motion detection illumination from the sun @Eduardo No, I am not familiar with that method. |
2016-05-14 11:12:38 -0600 | received badge | ● Student (source) |
2016-05-14 10:57:49 -0600 | asked a question | Motion detection illumination from the sun Hi, I have a raspberry pi which records videos on motion detections from a PIR sensor. Sometimes "random" heat variations will falsely trigger the sensor and record a video when there isn't any motion. If there isn't any motion in the picture I would like to filter out those videos. There are two criterias for a video to be saved: a heat varation triggering the PIR sensor and motion in the video. It works for most of the videos but I have noticed that illumination will sometimes vary a lot and mimic real motion in the video and trigger the filter falsely. My algorithm is very simple. It grabs three frames and calculates the difference and creates a binary image using cv2.bitwise_and. In order to remove noise it performs a morphological open on that differential image. Finally it uses cv2.countNonZero to determine the amount of motion in that frame. In the end i divide the total amount of motion by the number of frames (let's call this motion/frame) to get a number to work with. If this number is less than 800, the video is persumed to have no motion. Here are two examples (one positive detection and one false positive detection) As you can see from the latter, when the illumination varies a lot, it is falsely detected as motion. How can I remove these false positives from illumination changes? Another thing worth mentioning is that this filter will be run as a post-process, i.e it won't be in realtime thus I am okay with a solution that is a somewhat heavier performance-wise than my current one. |