Fun with Microscopes

I recently picked up a rather excellent little USB microscope, the Veho VMS-004.

For the bargain price of £29 (short term bargain at Tesco Direct) you get a 2 megapixel microscope, capable of 20x and 400x magnification.

The large sensor size allows some great images to be captured, but the biggest challenge, expecially at the higher magnification, is holding it and the subject matter still enough to take images.

The ‘scope does come with a stand, which is reasonable for the money, but it soon became clear that something more stable was going to be required for close-up work at 400x magnification.

The other issue you get at high magnifications is the lack of depth of field. If viewing an item with any significant variation in height the area in focus will be very small.

A friend mentioned that there is software available to do something called focus stacking, or extended depth of field imaging, by taking multiple images at different focal lengths you can combine them into a single image with the whole of the subject appearing in focus.

After some investigation I settled on an excellent piece of software called ImageJ. The primary advantage of this is that it is Java-based, meaning it’s cross-platform for use under Windows, Linux and Mac.

It’s a plugin-based system, whereby new plugins for new features can be added at any point in time. In my case I’m using three additional plugins, the complex wavelet based extended depth of field plugin, from the Biomedical Imaging Group and the StackReg and TurboReg plugins for image registration / alignment.

So armed with the tools, I simply needed a way to hold the microscope such that the focal layer images can be taken consistently and accurately with minimal image misalignment.

That was achieved by modifying an old PCB Drill Press, which allows very smooth vertical movement of the microscope, whilst keeping it stable over the subject.


This will be modified still further to add a vernier-style adjustement, using an M5 thread, which, given the thread pitch of 0.8mm will allow precise 0.1mm steps to be made for 1/8 turn of the adjuster. In the meantime I’m using the cam-based lever that was used for the drill itself, which I’ve fitted to a much more sturdy support block kindly machined for me by a work colleague.

The results are impressive, to start with, here’s an animated GIF a Youtube video showing the stack of 36 images at each focal point acheived with this setup. The images are of a small incandescent lamp filament

From the 36 images that make that stack, we first have to ensure they are perfectly aligned; even though the drill press keeps things aligned well, there are changes in perspective and subtle movements that are clearly visible at 400x magnification.

The StackReg plugin does an awesome job of this, using transformation maths I don’t fully understand, but am glad that the authors do!

From the aligned stack we then feed it into the Extended Depth of Field plugin, which uses the magic of wavelets (some more maths that’s beyond me!) to magically stitch the images together into a focussed whole.

Here’s the result.


Not bad for a first attempt and hopefully it will encourage others to have a go at this, if you have children, particularly younger ones, they are often fascinated by the tiny detail on objects otherwise invisible to the naked eye.

Comments and questions welcome!

This entry was posted in Education, Engineering, Gadgets, Microscopy. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *