youngsters at the feeders

I have a webcam pointing at the Blue Tit nest box but unfortunately it gets so much movement ‘noise’ that I end up with skipfuls of images and it’s hard to sort out the good ones and all sorts of empty images get uploaded automatically to my flickr photostream.

young hungry starlingThere’s always the conventional approach of pointing a real camera at the birds and pressing the button.

This youngster has landed on top of the fat feeders and is screaming at the adult nearby to come and feed him. The adult, however, is older and wiser, and has spotted me nearby and is keeping a wary eye on me.

I do like this picture and its drama with the youngster screeching for attention. But there’s always something nice about getting a photo of a bird on a natural perch. Here’s the same bird again balancing on a bit of hazel:

Starling on hazel

Not as excited this time but a more natural backdrop, which I like.

And every year we get young sparrows that are always good to see. I don’t know where they’re nesting because it’s certainly not the expensive roof terrace that I put up for them years ago and has been ignored every year.

House Sparrow

Bigger versions of these photos can be found in my zenfolio gallery.



Mask files, sizes, and motion.conf tweaks

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:

  1. Make a copy of an existing webcam image to use as the template. This way the dimensions of the image will be correct
  2. Use the Free Select Tool (it looks like the laso) to select an area that you want to be monitored for movement.
  3. 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).
  4. Click on the area to be filled and it should fill with white.
  5. 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.

Mask File for motion

mask file

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:

 

 

motion.conf options

Hmmmm, there are a few options in the motion.conf file I haven’t seen before. Or at least, that I can’t recall having seeing before. These look promising:

# Dynamically create a mask file during operation (default: 0)
# Adjust speed of mask changes from 0 (off) to 10 (fast)
smart_mask_speed 0

# 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 0

The trouble with creating a mask file is that it assumes the camera stays fixed in the same position, and that’s pretty unlikely. So I’ll try tweaking these settings and see what happens. Far less effort. Currently running at about 1000 images an hour. Let’s see if I can get that down a bit …

 

controlling the loco-motion

So here’s the problem:

[slickr-flickr tag=”webcam2″ type=”gallery”]

This is a USB webcam pointing at the nestbox. The software is motion, running on a Linux Mint box, and uploading to my flickr photostream using flickr_upload. There are a couple of homebrew shell scripts involved too.

The trouble is, even though the motion config file can be tweaked and various things twiddled to adjust various thresholds, most of which are black magic, all it needs is a windy day and I find I’ve got 40,000 or so JPEGS on my harddrive. All of blades of grass blowing in the wind.

So I think I’m going to have to create a mask file. I can’t remember how to do it, even though I’ve done it many times before. I’ll do that later. And I’ll write it down.