could Motion and the PI be used, not only to detect motion , but to learn which type of motion is good and which bad. For example.

In ones garden, if the cat walks thought and takes a sip pf water out of your pond, then merrily moves on. That's a fuuzzy feeling, and then kids are having fun. Could a computer program learn those things, to the extent that it would know that unrecognized man in out garden shouldn't be taking out bikes.

Do you think the Pi is capable of this, eg the computer knows that the trees move when its windy, so it ignores that tree, then a man walks in the gardens, which is very unusual compared to the last month's traffic profile, so the system should treat this a a threat, unless it has facial recognition too!

Can we move towards, software that teaches its self? We give it guidance, but it makes the Decisions.

Is this possible with the PI


3 Answers 3


Yes this is possible, though will require some study and perserverance, and a single RPI is likely not sufficient in CPU bandwidth (though this is by no means proven and multiple PIs could be federated to provide the needed capacity).

Motion is insufficient for this task, being merely a motion detection program.

What I would recommend is investigating Computer Vision through the open source library OpenCV.org, which has virtually every video analytic tool you are asking for, though "some assembly required", to put it mildly. Person detection and facial detection/recognition are already available, though again require thoughtful application.

For the self-learning aspects, you can assess neural networks, genetic algorithms, and many other techniques, though you would want to determine up front if your program would be trained, supervised, unsupervised, etc. This is a very broad question, though, so an indepth look at learning techniques would help to narrow your approach.


  • very interesting Will, i shall look into openCV.org, Thanks.
    – reggie
    Commented Feb 24, 2014 at 13:19
  • @reggie , keep us posted on your findings, I can help steer you in the right direction, as I'm currently using OpenCV (in Java) for motion detection, people detection, people tracking, and facial recognition, and am looking to use the Raspberry PI w/camera as one more means to collect video and detect changes at a minimum, off-loading the heavier processing to a desktop/laptop. OpenCV also has it's own StackExchange forum, so there are many thousands of questions already answered there. The key would be to break this problem up into bite size pieces. answers.opencv.org/questions
    – Will
    Commented Feb 25, 2014 at 14:05
  • This tutorial will get you started in C++ (I use Java, so I translated it). Tutorial: Background detection with OpenCV: mateuszstankiewicz.eu/?p=189
    – Will
    Commented Feb 25, 2014 at 16:15
  • thanks will,iv'e done a little c in the past, but just getting to grips with Linux!
    – reggie
    Commented Feb 25, 2014 at 16:42
  • OpenCV is available in Windows, Android, and iOS as well. opencv.org/downloads.html
    – Will
    Commented Feb 25, 2014 at 17:32

One good approach they use in undergrounds is called flow movement. They track moving items entering in the scene and follow them. After a while you can learn that people tend to enter the scenario (lets say a underground station) walk straight the to cashier, and straight to the "tolling machine" (not sure whats the English name). Other people my pass by the bin to throw something

But this is definitely different from a pickpocket who walks around waiting for someone to be distracted. This could be a good approach.

As for the cat, it should be easy to apply morphological detection methods to distinguish between a human being and a cat. Then it could be funny to declare allowed and not allowed areas.

What I clearly see is that you will need to place the camera far away, or to use more than one if you want to track people nicely for more than 2 meters.


If you have your mind set on using motion, the best you could do is probably setting the threshold value and the mask option of motion in the .conf file to ignore movements.

If you really need the Pi to learn complex normal movements, I too would say motion is not the appropriate tool.

  • 1
    I would suggest that the masking feature in Motion is far too limited to provide much in the way of ignoring normal movements. At best, it merely ignores all movement in an area that you designate.
    – Will
    Commented Mar 20, 2014 at 19:24
  • 1
    That is exactly true. I edited my answer to make it clearer. Thank you for the comment.
    – y3t1
    Commented Mar 24, 2014 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.