The tweaks don’t seem to be having much effect. Even with the lightswitch option set to 80, and the smart_mask_speed set to 10, it’s still pretty wild and windy out there.
# Dynamically create a mask file during operation (default: 0) # Adjust speed of mask changes from 0 (off) to 10 (fast) smart_mask_speed 10 # Ignore sudden massive light intensity changes given as a percentage of the picture # area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled lightswitch 80
So it has to be the mask file. The way the mask file works is by using an identically sized image as the webcam and making all areas to be monitored white, and all not to be monitored black. Or is it the other way around? I did this using the gimp and after a couple of false starts it turned out to be pretty easy. Here’s my rough notes:
- Make a copy of an existing webcam image to use as the template. This way the dimensions of the image will be correct
- Use the Free Select Tool (it looks like the laso) to select an area that you want to be monitored for movement.
- Select Bucket Fill. Under the section for Affected Area make sure it’s ticked for Fill Whole Selection. Make sure your foreground colour is white (I kept getting this wrong. It doesn’t matter. Just click on the arrows to reverse foreground/background and do it again).
- Click on the area to be filled and it should fill with white.
- For the background, go to Select -> Invert, then swap your foreground and background colours. Click on the area you want to be black
You need to save this as a ‘pgm’ file. For some reason a pgm file is huge compared to a jpeg, e.g.
-rw-r--r-- 1 dougie dougie 691254 2011-05-25 14:24 mask1 - 25May2011_1407.54-00.pgm -rw-r--r-- 1 dougie dougie 12639 2011-05-25 14:26 mask1 - 25May2011_1407.54-00.jpg
although I’m sure it’s possible to reduce the size there doesn’t seem much need at the moment.
Now it’s just a matter of pointing the appropriate option in motion.conf at the mask file and seeing what happens.
Here’s my first attempt:
One thought on “Mask files, sizes, and motion.conf tweaks”