I'm working on this project from a while now but unable to achieve the target.. I'm using a raspberry pi B+ board with the raspicam.. i have tried my hands on with hog descriptor, haar cascade, but the pi is too slow to all these methods.. The detection rate is also very less even of fast machines for the above methods.. my project demands real time results on real time video.. i need to detect pedestrian at night in a corridor.. at anyone suggest the best method to achieve this which requires less cpu??

  • An alternative to using the raspberry pi would be to use infrared LEDs and infrared detectors, when someone walks down the corridor past a certain point the beam of infrared light would be broken. Each time the beam is broken a person must have walked past. This would be more practical than using a camera at night
    – Darth Vader
    Apr 27, 2015 at 16:30
  • Thanx Darth for your suggestion but actually the problem is stray dogs and animals also sometimes enter the corridors.. so we dont want to false trigger the relays.. thus human detection is necessary.. Apr 28, 2015 at 7:10
  • that problem is easily solved you have one low level infrared beam and one higher up. If only the low level infrared beam is broken then it must be an animal. If both are broken it must be a human.
    – Darth Vader
    Apr 28, 2015 at 16:00

1 Answer 1


Using the Raspberry Pi Camera at night is going to have problems, firstly you will have to increase the ISO to high levels to see anything in the dark. This means poor image quality and would make detecting things like people harder.

My solution would be to set up infrared LEDs on one side of the corridor at different heights. Then set up infrared detectors on the other side of the corridor to the infrared LEDS. The infrared from the infrared LEDS will be detected by the infrared detectors, when an object walks down the corridor it will break the beams of infrared light. This is then detected by the infrared detectors, so every time the beam is broken something must have walked down the corridor.

Your other problem is things like stray animals breaking the beams of infrared, triggering your relays. This is easy to solve because the animals will only break the low level beam of infrared, a human will break both the high level beam and the low level beam of infrared. So if only the lower beam of infrared light is broken an animal must have walked down the corridor.

You can still use the raspberry for this project because the infrared detectors can be connected to the GPIO on the raspberry pi. A simple python script would then be used to process the inputs from the infrared detectors. Generally speaking python scripts use a medium amount of CPU depending on what raspberry pi you are using, so this solves your high CPU problem as well.

  • Thanx a lot Darth.. Apr 29, 2015 at 9:28
  • can you suggest any ir cam compatible with the rapberry pi which can be used instead of picam Apr 29, 2015 at 9:57
  • As suggested in my answer you set up infrared LEDs on one side of the corridor and infrared detectors on the opposite side of the corridor, the infrared detectors are then connected to the raspberry pi. If you hell-bent on using a camera there is the Raspberry Pi NoIR camera board, check this page: raspi.tv/2013/…
    – Darth Vader
    Apr 29, 2015 at 16:04
  • im already using this cam May 6, 2015 at 10:15
  • Why did you ask me to suggest an infrared camera compatible with the raspberry pi then?
    – Darth Vader
    May 7, 2015 at 6:56

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.