Close

Defocused Computer Perception - Python & OpenCV

A project log for Happy Vertical People Transporter

Douglas Adams envisioned a Happy Vertical People Transporter as opposed to the mundane every day elevators

digigramDigiGram 03/19/2014 at 21:320 Comments

My previous attempts at computer vision was all done in Python with numpy. With arrays I detected movement (very poorly) and distance with a laser and some trigonometry. This time I wanted to try and figure out openCV. Turned out to be so easy! The basic gist of the Defocused Computer Perception [DCP] is as follows:

> Read all connected webcams in a loop //Currently only one is read

> Compare successive images. If movement is detected (and above threshold), figure the center of the movement

> Apply a crosshair or circle to the point to show on display where movement was detected

> Next call the HVPT to the floor where movement was deteced.

> The crosshair will be redrawn for all movement, but the call command will only be issued once per passenger.

> The crosshair is not really needed, but it does give the system an AI feeling.

> If time allowes, the movement might be used to detect if someone is walking to or from the HVPT. Or if a second passenger is spotted, the HVPT can wait for them, or speed up to save the first passenger from unneccesary chit chat.

> For every 42nd passenger, the HVPT gets a psycotic breakdown and need to go to the basement for councelling (where Marvin awaits for 500 years). The breakdowns are real in the books, the basement is my spin on it.

> This quote is extremely important to remember when you do encounter bugs (or abnormalities as I call them) in the code from the book series: "their fundamental design flaws are completely hidden by their superficial design flaws"

Alpha code can be found here: DigiGram GitHub

Discussions