2013.05.01 - green island

few days ago we've came back from Ireland. beautiful views, nice weather (except for when it's raining), smiling ppl… really nice! :) see for yourself – click on the image to enlarge.

helipad in the end port sunset 1 sunset 2 edge of the mountains windy coast

of course how can one leave home w/o 21st century security? or at least a camera… ;) i already had RTSP streaming camera with a bit of software for linux to control it. there was one problem – i was unable to find app for monitoring, supporting RTSP OotB. it was already less than 12h to flight. what can we do? well – how about python OpenCV API? in about two hours i came up with a set of shell/python scripts to do this for me. pack of scripts for capture and analysis consist of 4 individual elements:

  1. dump_rtsp (11 lines / bash) – using mplayer stores stream on disk. this is required, since image processing module does not support direct RTSP input.
  2. show_diffs (50 lines / python) – python/opencv script that detects movement by computing differences between consecutive images.
  3. run_for (20 lines / bash) – recodes raw stream from mplayer as mpeg4 for opencv input. it records 2h and then runs movement detection algorithm on this data pack.
  4. RUN_ALL (9 lines / bash) – wrapper that starts both capture and process scripts, communicating via named pipe.

and so a simple movement detection facility has been created! :) some observations:

  1. using libraries rocks. ;)
  2. scripting languages are fast to write – whole “system” is juts 90 lines of code!
  3. interesting part is communication via named pipes, since commands require file name to operate on.
  4. for security, files were stored on the remove drive, mounted locally with sshfs. local copies were used for analysis only. in the end, what good is “local” monitoring, when in case of actual brake-in, your hard drive gets stolen? ;)
  5. cheap cameras sucks. when light was dim, but it was not fully dark yet, infrared LEDs were turning on and off every few frames, casing A LOT of false positives, few times per day. manual on/off needs to be added, to make it actually reliable.

enjoy your holiday time! :)

blog/2013/05/01/green_island.txt · Last modified: 2021/06/15 20:09 by 127.0.0.1
Back to top
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0