View Single Post
Posts: 309 | Thanked: 519 times | Joined on Oct 2010
#1




Hi folks

This is a small motion detector I wrote using the CImg library and FCam API.

The App is split into 3 components:
  • Motion Detector
    Detects motion and records to file. Can also send images via email.
    • Mask Size: Determines sensitivity of motion detection. The lower, the more sensitive (and more false positives). A high mask is generally favoured. If you specify a large image size, then you should specify a high mask too.
    • Show Image: Tickbox ensures that the frame where movement was detected will be shown. This comes up as a purplish image due to QPicture and FCam having wierd color issues. Will sort out later.
    • Threshold (the lower it is, the more sensitive)
    • Duration (HH:mm:ss) (default 00:01:00)
    • Max and Min Intervals. You don't want the detector checking for motion every second, so to save resources it fluctuates between these two interval ranges.
      Initially it starts at an interval halfway between the Max and Min. If motion is detected, it halves the interval and checks again. If motion is still occuring it keeps halving down to the min limit.
      If motion is not detected for 10 frames, the interval is doubled, and so forth, up to the max interval.
    • Modifier affects the halving/doubling of the interval. Lower = more sensitive, Higher = least sensitive.
    • Image sizes (320x240, 640x480, 800x600, 1280x960)
    • Image save directory. When motion is detected, movement frames are saved here.
    • Options to convert images to MPG when finished, and to delete images.
    • Email option to email user with an attached image of movement.
  • Time Lapse
    Records images at specified intervals. Essentially just a cronjob, but uses libalarmd.
    • Until: Specify the day and time to end photo capture.
    • Repeat: The frequency of photo cpature, up to the Until date. Repeat Never option takes just a single photo at that date
    • Image: Image size and framerate of video (if user wants to convert)
  • IP Streamer
    This is not working yet. This will essentially be the slot to launch a completely revamped version my current PhoneStreamer App. I've made a lot of changes to Phonestreamer, but haven't had time to implement it into the WatchDog yet. Todo.

There is also commandline functionality for remote usage, and users can run the app with various flags and switches.
For more info:

Code:
/opt/watchdog/bin/watchdog --help
note: weird bug where it throws an error for certain time values.
fix: Add
Code:
PATH=$PATH: /opt/watchdog/bin/
export PATH"
to the end of /etc/profile. Restart phone, then just run
Code:
 watchdog -x -y -z -etc
where x y z etc are whichever flags you choose.


Installation
On extras-devel! Just need to update and install:
Code:
root
apt-get install fcam-dev fcam-drivers
apt-get update && apt-get install watchdog
TODO
* Fix layout bugs
* Fix target bug for timelapser
* Add SMS, warning sound
* Port to Harmattan


Warning
It works, but it's buggy as hell and will crash on you at least once - I am warning you that of now.

It was developed in just a few weeks and so there hasn't been much time to polish it. Absolutely will do once I finish the writeup, but till then - hang on.

Also, if you guys could post any bugs or suggestions here, I'd be really grateful. Thanks guys

Old-Deb Link: https://docs.google.com/open?id=0B0-...lBXUjZFT2d6T0U
__________________
PhoneStreamer - VLC/Webcam/Audio streaming to your PC. Also it's a SPYCAM app
WatchDog - Motion Detector and Time Lapser. Securicam!

Last edited by tetris11_; 2012-12-27 at 14:55.
 

The Following 67 Users Say Thank You to tetris11_ For This Useful Post: