Introduction

MycoCam 2 is the second generation of Shotbolt Designs' WindowsTM program for capturing and processing pictures from webcams or other video capture devices and allowing measurements to be taken directly from them. Many improvements and new features have been added in response to feedback from customers. The main changes from MycoCam are highlighted in maroon.

MycoCam is intended primarily for use in conjunction with a microscope, when an accurate measuring photomicrograph can be achieved at low cost, and large numbers of formerly tedious measurements can be made very quickly. Most webcams (or digital cameras with webcam capability) will work well with a microscope, but some experimentation will be required to devise a suitable mount. Brunel Microscopes Ltd (www.brunelmicroscopes.co.uk) sells a range of camera adapters and a x10 photo projection eyepiece.

You can also make measurements and perform image-processing on image files loaded from digital cameras without webcam capability, or indeed from any source; the maximum image size is limited only by the available memory but real-time image processing on large images requires a large percentage of system resources.

System Requirements

·        Fast multimedia-capable PC, 600MHz minimum recommended. MycoCam is computationally intensive, especially when real-time image-processing is enabled.

·        WindowsTM 98, ME, 2k, XP or later.

·        Minimum 800 x 600 display using 24bit or 32bit True Color mode.

·        DirectX 8 or later is required. If not installed as part of Windows, it is available for download from Microsoft's web site. Test MycoCam first, and see if it displays correctly.

Copy Protection

The download version of MycoCam2 is completely functional, but will expire after 30 days. You must then pay for it and register it to unlock it. When MycoCam2 is run, a small window will appear until it has been registered. This window will show a 4-character code which you must email back to the author in return for a unique 16-character unlocking code.

Visit the shop page to pay by PayPal.

Running MycoCam 2

Plug in your camera or other capture device then run MycoCam 2. The controls are on the left of the window by default; you can change this if desired by choosing Options, Align Controls Right.

You will notice that there is a series of tabbed pages which you can select:

  • Preview - choose a video device, set up its operating modes and view full-speed live video.
  • Process - process the live pictures from the camera and adjust them prior to image capture.
  • Measure - view the captured image, and measure and annotate objects.
  • Compare - view a comparison image and associated measurements.

Many of MycoCam's options and features are accessible through popup menus activated by a right-click. Experiment with right-clicking the images, measurement grids and other controls to familiarize yourself with what can be done.

The Preview Page

The Preview Page is where you choose a video device, set it up and view the full-speed live video.

The Devices and Modes treeview control shows all the connected video devices; clicking the '+' box shows the different modes available for that device. Click a mode to select it, and a live image will appear.

Set up your camera
Depending on the features supported by the video device, various buttons below the treeview will be enabled. The Camera Settings button, if enabled, allows various manufacturer-determined options to be set up for your camera. These include options such as brightness, white balance, sharpness etc.

The camera mode is automatically saved on exit, and will be recalled the next time MycoCam is started.

If your camera does not have a live video mode, you will not be able to use the functions on the Preview page, but you will still be able to process and make measurements on images that you have previously transferred from the camera from the Process and Measure pages..

Focus the picture
Observe the live image while very carefully adjusting the camera focus for best clarity. In Preview mode, MycoCam will display frames as fast as the video device can deliver them.

The Process Page

The Process page includes many features to enhance your pictures. It can be used both on live video, and on images loaded from file.

Image Size
Enter the size that you want the image to be displayed at. Irrespective of the captured image size, or the size of the image loaded from file, the image will be resampled to the size you specify in the W and H boxes. When a width is entered, the height is automatically set to 0.75 times the width. You can change the height afterwards if you want. The maximum size of the processed image is 1600 x 1200 pixels, and the minimum is 160 x 120. For most purposes a size of 640 x 480 will suffice, and larger sizes will noticeably slow the performance.

Picture Processing
MycoCam can process video images in real time. This is computationally very intensive and on a slower PC may appear sluggish. The following effects are provided:

Picture Orientation
Use the FlipX checkbox to flip the picture left-right, and FlipY to flip it up-down. This is very useful if you want to work from the other side of your microscope.

Despeckle
Click the Despeckle check box to apply a Median Cut filter to remove most of the speckles. This will blur the image slightly.

Sharpen
Click the Sharpen check box to sharpen the image. This can be used in conjunction with Despeckle.

Find Edges
Click the Find Edges check box to show where the sharp edges are in the picture.

Negative
Click the Negative check box to show the image as a negative.
This can sometimes appear to improve clarity.

Picture Correction
Two slider controls allow you to correct for aberrations or perspective in your camera. The upper slider adjusts the squareness by a small amount. Use this control to make circles look circular. If you can not find a suitable circular object, use a ruler or calibrated slide. You can check the adjustment by rotating the camera through 90 degrees.

The lower slider compensates for radial distortion in the lenses, and for perspective. Adjust this to make straight lines near the edges of your image look straight.

Color, Brightness and Contrast
These sliders allow you to adjust the color balance of the picture, and to set its overall brightness and contrast. You can achieve a warmer 'tungsten lamp' effect by moving the red and green sliders up together to increase the yellowness; conversely you can increase the blue slider for a 'daylight' color balance.

Reset All
Click the Reset All button to restore all image-processing defaults.

Flat-Fielding
MycoCam uses an advanced technique called flat-fielding to remove the effects of dust on lenses, imperfections in camera electronics, uneven lighting etc. A grossly-defocused picture is taken and processed to result in a uniform user-defined color in the final image.

Click anywhere in the preview image and you will notice that the box to the right of the Color -> button changes to the color of the point that you clicked. For the most effective flat-fielding, click on a point that is most representative of the background color of the preview image. Click the Color -> button. After a short pause the preview image should show a uniform shade of color. The corrections are stored and applied to all subsequent images. You can remove the flat-field correction temporarily by unchecking the Use Flat Field Correction checkbox, or permanently by clicking Cancel.

Grab Image
When you are happy with the picture as displayed in the Preview page, click Grab Image and you will be taken to the Measure page where the captured image awaits your measurements.

As a shortcut, you can grab an image by double-clicking it.

Open an image from file
In addition to grabbing live images, you can also capture and process image files from disk. Right-click the picture and choose Open File. You can then select an image file of virtually any format to load and process. To return to live image processing, right-click and choose Live Video.

Making Measurements

The Measure Page provides tools for taking accurate measurements from the captured image and analysing the results. Many of the features are accessed from a popup menu launched by right-clicking the picture.

Measuring with MycoCam
Left-click any point within the Measure image. Notice that an annotation in the form of a number in a white box appears immediately to the left of the pointer. Repeat, this time holding the left mouse button down while dragging the mouse. A circle will appear. One point of the circle (the first point you clicked) remains fixed while the other follows the mouse pointer. When you are taking measurements for real, these two points represent the extents (length, width or depth) of the object you are measuring.

Release the left mouse button. Notice that the circle size now remains fixed, while the center of the circle moves with the mouse pointer. You can now change the size of the circle with the cursor keys, or alternatively with the mouse wheel if you have a wheelmouse.

Change the measuring circle color
Right-click the picture and select Toggle Measuring Circle Color [C]. The circle outline will toggle between black and white.

Calibrate the measuring circle
Before taking measurements, it is necessary to calibrate the measuring circle. Go back to the Preview page and use Capture Image to take a good picture of a measuring slide, ruler or other object of known size. Left-click the object on the Measure page and drag the circle until it represents the dimension you want to use for calibration. Now right-click and choose Set Circle Size [S] from the popup menu. Enter the actual dimensions of the object when prompted then click OK. The circle can now be used for accurate measurements. Experiment with clicking, dragging and resizing the circle until you are familiar with the measurement process.

Save calibration to a lens file
To avoid having to repeatedly set the circle size, you can save the calibration to disk. In the main menu, choose Calibrate, Save Lens File. Enter a brief description of the lens then click OK. You will then be prompted for a filename, with the description as the default. Click OK to accept, and the measuring circle scaling and picture size will be saved.

Load calibration from a lens file
To use the predetermined calibration settings for a particular lens, choose Calibrate, Load Lens File from the main menu. Select the correct calibration file then click OK to accept. The measuring circle scale and picture size will be loaded.

Accurately measure objects
Go to the Process page and take a good picture. On the Measure page, right-click the picture and choose New Measurement [N] from the popup menu. Select an object and use the left-click and drag to measure the longest dimension of the object. Use the mouse wheel or cursor keys to adjust the circle size if necessary.

To log the length in the measurement table on the right of the page, right-click the picture and select Update Length [L]. Now measure the shortest dimension of the object and log it by selecting Update Width [W]. If the nature of the objects allows you to determine the depth as well, select Update Depth [D].

Note: If the width is greater than the length, MycoCam2 will not treat this as an error. You can turn on an option to automatically swap Length and Width so that Length is always the greater by setting the menu item Options, Auto Swap if W > L. Note that spore length is always taken as the dimension through the apiculus, and some spores may be broader than long, although this is not very common.

To measure another object, right-click the picture and choose New Measurement [N].
To delete the current measurement, right-click the grid and choose Delete Measurement [Del]. You can also delete a specified measurement from the table by selecting it first before right-clicking the grid and selecting Delete Measurement.
To clear all measurements, right-click the grid and choose Delete All Measurements [Ctrl-Del]..
To undo the last change to the measurement table, right-click the grid and select Undo Measurement Change [U].

If the menu item Options, Auto New After Width is checked, MycoCam will automatically start a new measurement after the width has been entered.

Measure objects larger than the circle will allow, or replace a previous measurement with a new one
Measure part of the dimension in question, log the measurement and note where the circle finishes. Start a new circle and extend the measurement. Now log the measurement again without choosing New Measurement. MycoCam will give you three options:

  • Click Yes to add the new measurement to the previous one.
  • Click No to replace the old measurement with the new one.
  • Click Cancel to ignore the new measurement (useful if you intended to start a new set of measurements but forgot to select New Measurement!)

Automatically grab images for measurement
By selecting the menu item Options, Auto Grab Processed Image, you can make measurements on an image which is automatically updated once per second. In this mode, you can not add annotations to the image.

Keyboard shortcuts

The letter after each popup menu item represents the shortcut key you can press as an alternative to right-clicking: It is worth memorising these as they speed up data entry considerably:

  • N - New measurement
  • L - Update length
  • W - Update width
  • D - Update depth
  • Del - Delete measurement
  • Ctrl-Del - Delete all measurements
  • U - Undo measurement change

Length/width ratio (Q)
The fourth column in the measurement table represents the ratio of length to width, often called Q. This ratio is very well defined for certain organisms e.g. fungus spores, and can prove a useful aid to identification in conjunction with the length and width.

Review measurement statistics
The table below the measurements shows the minimum, average and maximum values for length, width, depth and Q for the current set of measurements.

Copy measurements
Right-click the measurement grid and select Copy Measurements. The entire list will be copied to the clipboard, with each entity separated by tabs. This format is compatible with most spreadsheets, and the data can be pasted straight in.

Save measurements to a CSV file
The entire measurement grid can be saved as a CSV file. This stands for comma-separated values, and is a good way to export data to most database and spreadsheet programs. Right-click the measurement grid and select Save CSV File.

Annotate the picture
Right-click the picture and select Freeze Annotation [F]. The measurement circle and its associated annotation will become part of the picture. Choose Toggle Annotation Mode [M] to switch the annotation between the circle size and a comment typed into the Notes box above the picture. To undo an annotation, choose Undo Last Annotation [Ctrl-Z]. To remove all annotations and other picture changes, choose Undo All Picture Changes [Ctrl-A].

Zoom in on the picture
MycoCam provides the means to zoom in closer on areas of interest. Use the click and drag method to produce a measurement circle centred on the area of interest. Before you release the left mouse button, press and hold the Ctrl key. Release the left mouse button and the area encompassed by the circle will expand to fill the picture. The circle scale will change accordingly so that accurate measurements can be made on the enlarged area. To restore the picture to its original size, right-click and select Undo All Picture Changes [Ctrl-A]. All annotation will be lost as well.

Save pictures, measurements and settings
Click Save File. You will then be prompted for a title. Enter something relevant and click OK. A dialog box will prompt you for the name of the .cam file. Enter a filename and click OK, and the picture and all the program settings and measurements will be saved.

For example, if you save a picture as spores.cam, a file called spores.cam containing all the settings is created, plus a JPEG image file of the actual picture called spores.jpg. You can view and edit the JPEG file using image-editing programs, but you should not resize it or MycoCam will not display it properly.

As an alternative to the button, you can right-click the picture and select Save File.

Load pictures, measurements and settings
Click Open File and choose the .cam file that you want to review. The picture will be loaded and the program will adopt all the settings (measuring circle scale etc.) which were saved with the picture. The associated measurements will be shown in the grid.

You can also load .jpg  image files. If a .cam file does not already exist for the image, it will be created. If a .cam file already exists you will be asked whether to delete it; you should choose yes if you want to use the current measuring circle settings etc.

As an alternative to the button, you can right-click the picture and select Open File.

Grab an image from the Measure page and save to file
Right-click the picture and select Save Image File [J]. The picture with any annotations added will be saved to the chosen image file format. You can choose either JPG, GIF, PNG or BMP file formats.

Return to the Process page
Either select the Process tab, or double-click the Measure image to return to the Process page.

Enable sound effects
Choose Enable Sounds from the Options menu to produce camera sound effects when the Process or Measure images are double-clicked.

Making Comparisons

The Compare page allows you to compare the image you are measuring with a second, stored image.

Load pictures, measurements and settings for comparison
Click Open File and choose the .cam file that you want to use for comparison. The picture will be loaded into the Compare page but the measurement settings are unaffected. The associated measurements will be shown in the Comparison table.

You can also load .jpg  image files. If a .cam file does not already exist for the image, it will be created. If a .cam file already exists you will be asked whether to delete it; you should choose yes if you want to use the current measuring circle settings etc.

As an alternative to the button, you can right-click the picture and select Open File.

Percentage match
The box to the right of the Open File button shows the percentage match between the data in the Measurements grid and those in the Comparison grid.

Copying to the Clipboard

You can copy the MycoCam form or any of the displayed images to the Windows Clipboard for pasting into other applications. When copying, ensure that no other windows are overlapping the one you want to copy.

Copying the form
Select Copy Form from the main menu. An image of the whole form excluding title bar will be copied to the clipboard.

Copying pictures
Right-click a picture and select Copy Image. Depending on which page you are viewing, a copy of the Process, Measure or Compare pictures will be placed on the clipboard.

Printing

MycoCam will print the complete form with whatever page is currently visible. When printing, ensure that no other windows are overlapping the one you want to copy.

Setting printer properties
Select Print Setup from the main menu. The standard Windows print setup dialog will appear. Choose the Landscape option for your printer if the paper size is less than 9” (25cm) wide.

Printing the form
Select Print Form from the main menu. An image of the whole form including picture and measurements but excluding the title bar will be sent to the printer.

Contacting the Author

MycoCam2 was written in Object Pascal by Richard Shotbolt, using Borland Delphi 5. Please send requests for advice, bug reports, suggestions for improvement etc. to the author.