Showing posts with label Timelapse. Show all posts
Showing posts with label Timelapse. Show all posts

Tuesday, 12 August 2014

How to grow your own butterflies

Butterfly kit

For Christmas we were given a "Grow your own butterfly kit".

<- Something like this

Included is a net (grandly called a "Pavillion").  You then send away for caterpillars, which arrive in a self-contained pot containing an agar-like food substrate which sees them through to the point that they form the chrysalis, which you then transfer to the pavillion to hatch.

Our kids have done this at school and we thought we would have a go at home.

The supplier guarantees that you should get some butterflies.  With each pot containing five caterpillars, from two pots, we got 5 to butterfly stage.  Some were lost at the pupating stage, and some didn’t make it at emerging from the chrysalis, having got tangled up in web.  We did have a couple of 'Special-needs' butterflies with deformed wings due to this problem.

The supplier used  Painted Lady caterpillars, which turn into butterflies like the one below, tastefully feeding from an Echinacea.


The kids gave all the caterpillars names.  'Ninja Guy',  'Weapons Guy', 'Hairy' and 'John' (I kid you not) made it to the butterfly stage. 

I thought it would be cool to film the key events of pupation and hatching - which proved trickier than I had thought.  I used a Microsoft LifeCam Cinema webcam & Raspberry Pi, with video stream captured using iCatcher Software on a networked PC.

Pupating
This has got to be the grossest thing I have seen for a while....


This  action took place over a 30 minute period, and is speeded up.  Basically the skin of the caterpillar splits at its head, and then sloughs off up its body.  It then wriggles about to push off  the shed skin after which it settled down and the crysalis hardens.  Unfortunatey this was one of our failed attempts since the crysalis formed a really odd shape and it didn't progress.

Butterfly emerging
Much less gross this time, I missed the first one to hatch, but caught two others. Of interest is the red fluid which is ejected which is apparently all the left-over bits of caterpillar that it didnt need to become a butterfly.  I'm sure there is a more technical description, but it was good enough for the kids!

Speeded up over two hours, shows hatching, and wing expansion and expelling of the 'caterpillar juice'.... cool eh?


Release
There are two schools of thought on whether or not to release into the wild.  Some advocate not doing this as these are essentially not wild.  My view is that at worst, we're contributing to the food chain... This is 'Ninja Guy' posing for the camera.



I'm told this is Hairy, but to be honest it could be any of them...


The butterfly net is packed away for next year... ant farm anyone?

Wednesday, 4 June 2014

How to make timelapse trail cam videos

I've had my Trail Camera sited in a variety of places in my garden for a few months now, with varying degrees of success.  The camera is described in this post, and can be configured to capture either video or images.

The theoretical maximum resolutions of each mode are:
Video: 640 x 480
Image:  8 Mega Pixels - I'm not sure how this translates to an actual resolution

It has night and daytime modes, Night time illumination is achieved via the in-built infra-red (IR) LEDs that surround the camera.  Not surprisingly, captured image quality is much better in daylight.  The following images are the full 8MP.


It also has a weird intermediate mode, which seems to be in low light where the IR illuminators haven't come on, however its IR filter has come off which give some interesting images.  In the following set, the top image is low light in the evening.  IR illuminators havent come on, but the internal IR filter is off the camera leading to this 'ghostly' image.  The one below is a true night time image - illuminated by the camera's IR LEDs.


Interestingly, it looks like the image resolution is automatically dropped for night time images as the field of view seems narrower - these two images are taken approx 6 hrs apart without the camera having been moved.  For the best quality images I've found that a cloudless sky with a full moon gives the best images, producing a more evenly lit scene.  My favourite bit of footage so far is that of a badger mother + cub tucking into a slow worm.  I've uploaded the original clip here:


Pros & cons
Using a trail cam is a great way of observing wildlife behavior that you wouldn't normally see (I did cheat a bit and put down peanuts in the area in front of the camera an in the long grass to keep the badgers interested).  One limitation is that once its set to video or images, it stays that way until changed.  A cool option would be to have it take a high res image, then capture a video clip - unfortunately not an option.

Make a time-lapse of still images
I've found that on some nights I have a load of okay-ish images, but nothing that would win any prizes.  I took a leaf out a stop-frame animation project I did with one of my kids on her Raspberry Pi.  I used the same approach generating the video in a post I did on how to make time lapse videos of clouds.
The advantage of doing this is that you effectively increase the resolution of the video, since I'm using the higher resolution still images.  The result is kind of jerky but I think its an interesting effect.  The following clips are encoded at 4fps:

To achive this, I've used mencoder in Ubuntu - but this should work on a mac PC too.  There's an install guide for mencoder on the Rapsberry Pi here, but you're better off running in a full-fat linux system such as Ubuntu or on a Mac PC.

ls *.jpg > list.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o video.avi -mf type=jpeg:fps=4 mf://@list.txt

Selection of 'Time-lapse' videos from Trail cam still images: 
These are best viewed full-screen with HD option selected

1) Adult female badger 'in-milk'.  You can see that this badger's udders are clearly visible suggesting she has cub(s)


2) Soggy female badger and her cub.  I cant be sure this is the same female badger, but if so, this is one of her cubs with her.


3) ...and finally badger cub on its own:



Make use of poor quality inages
I had one night where many badgers stopped by for peanuts, but unfortunately I either had rain on the lens, or its was misty.  The resulting images were no use, but strung together into a time-lapse, gives an idea of what is going on.... Lots of badgers

Still used to create the following time-lapse


I'll sign off with a couple of new additions:




Tuesday, 25 March 2014

Timelapse Raspberry Pi Camera

Last weekend I tried my hand at some time-lapse movie creation

To do this, I've used the Raspberry Pi camera module + Raspberry pi


This high-tech setup attaches a Pi & camera module to my sons bedroom window with electrical insulation tape.  raspistill is run using the following command:

       

raspistill -o image_%05d.jpg  -n -tl 5000 -t 72000000 &

       
 

The above command only creates a set of jpg files, each approx 2.5Mb, and not the final video clip.  (The ampersand keeps it running in the background)

The final clip is created with mencoder.  See here for detail on how to set this up

       

ls *.jpg > list.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o timelapse.avi -mf type=jpeg:fps=20 mf://@list.txt     
 

Attempt 1
My first attempt was okay, but suffered from reflection of the Pi's camera light.  this can be turned off by following these instructions.  This is also captured every 30 seconds, which I felt was a bit too speedy once combined at 25fps

Attempt 2
This clip was created on the following day, with the wind in a more 'atmospheric' direction relative to the window.  I soon discovered that I was limited in the length of video clip I could create by the space on the Pi's SD card.  My solution was to create a share on the Ubuntu machine, mount it on the Pi set the output destination for raspistill to save there, rather than the Pi's SD card.

With this approach I was able to leave it running for approx 8hrs, over which time it generated 14Gb image files.  Using mencoder, this converted into a 250Mb avi file, and encoded at 25 fps created a video of 3:30 minutes long, and I'm quite pleased with it.  It could be improved with some background music... maybe The Orb's Little Fluffy Clouds?  Best viewed full screen in HD.



I opted in this one for a 5 second time interval.  There's a handy guide here which gives some suggestions as to appropriate intervals based on what you want to timelapse.  The astute among you will notice that there is a skip in the middle of this, which is where my laptop decided for 15 mins or so to drop off the network.  the problem with defining the output of raspistill to a network share is if it stops sharing for some reason the capture will fail.

A more elegant solution would be to capture directly to the SD card as a buffer and periodically move to external HD/network share.  I also noticed that the output jpg didn't make it across sometimes where raspistll would complain of dropped frames.

I particularly like the end where there's a brief flash of red as the sun sets off camera.  Quite pleased with the end result.