Some Context

For a project I'm working on, I'm creating a security camera that detects motion. When the camera has detected motion, it checks again to see if that motion was caused by a human. This avoids the camera being triggered by animals, cars etc.

Now there are two main ways I thought I could do this.

  1. The original way I was going to do this was capture 5 frames. I would then process these images to check for motion by averaging the pixels to create a single image, and comparing that to the image from the last 5 frames. If a certain threshold of pixels had change, motion would be detected.

  2. I could do this using a stream and continuously checking the live image for motion. This seems better for the next phase, which is to identify if that motion is caused by a human.

I'm going to be using this project on this Picamera from Amazon. I have a Raspberry Pi Model 3B+

Based on this hardware, which is the most viable option. Theoretically, I can code both but would doing it in real time put too much pressure on a Raspberry Pi? I don't want to overwork it, but I do want to get the most out of it.

I did ask about this question on Meta: Help narrowing down a broad question but it didn't receive any replies

  • 3
    The Pi appears to be irrelevant to the question.
    – joan
    Mar 11, 2019 at 12:45
  • @joan Yes, I understand your point. I'm on mobile at the moment, however when I can access my desktop I'll edit for some clarity there. Mar 11, 2019 at 14:16
  • So I've updated the question with how I was intending to ask it here. But if it's getting too software based could it be migrated to Stack Overflow? Mar 11, 2019 at 16:43
  • @joan Jake in my opinion this question is about raspberry pi since the main question is: "Does the pi have enough resources to do this"? Mar 13, 2019 at 0:26

1 Answer 1


one answer no one would like to hear when asking a question is probably "it depends", but in your case: it really depends.

As you have a concrete use case, you could start with a simple project: By setting up motion (https://motion-project.github.io/motion_config.html) and playing around with the configuration options for a motion, e.g., how long should a video be recorded, when pixel changes over a certain threshold are detected. You can then setup an alert informing you whenever a new motion is detected. This way you can get a feeling for what is missing in your current approach and what suffices your needs. If you do not like to completely start from scratch - there are a lot of blog posts on surveillance with raspi and motion, where you can decide for the approach which best suits your needs.

A few more notes/examples on 'it depends':

  • Sometimes the first idea is always 'lets use a camera for solving problem XYZ', but after discussing in detail it turns out that another sensor would do a better job
  • Think about the priorities, is it real-time you most care about, e.g., because you want to open the door before your visitors are ringing the door bell? Is it the detection of human and/or the separation between human vs. animal? Is it the motion and with the motion you are also interested in direction, acceleration, ...?
  • ...

btw. the title confuses me: the phrase "still frame" in image processing refers to image

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.