Search code examples
cimage-processingcomputer-visionmotion-detection

Motion detection algorithm for neglecting motion of vegetation?


I'm trying to write my own software for security camera motion detection, but in the area of interest outside my house, there is a lot of vegetation motion that will obviously trigger recording if I use some of the more simple algorithms that rely just on the difference between images. Does anyone have any recommendations? I'm struggling to find motion detection information online. I'm guessing that I'll have to employ some edge detection, or maybe a filtering process. Cheers, Zan


Solution

  • Without having seen any of your recordings I would suspect that motion from the vegetation looks quite noisy and more random with only a few local edges as in contrast I would expect much stronger connected edges for people that move through the scenery. Also edges from objects moving on the floor will be mostly be oriented on specific directions for a longer period of time.

    My first attempt would be

    1. median filter on input image to reduce noise
    2. difference image to previous (may be 2nd previous) image
    3. some edge detector
    4. build some edgelists based on the stronger
    5. filter out weak/short edges
    6. match edges from objects in last frame against the newly found
    7. apply some tracking of positions and other features
    8. classify object behaviour based on this features
      • consistent movement in one direction
      • consistently strong edges on the same object
      • object size
    9. to trigger your recording

    Alternatively you can jump on the recent Hype of Deep Neural Networks. Look up online information and tools (and maybe embedded hardware) to train and run a CDNN.

    Split your current videos into

    • videos there you do not want to be warned
    • videos there you do want to be warned

    let the magic happen.