Microscopy Primer
Light and Color
Microscope Basics
Special Techniques
Digital Imaging
Confocal Microscopy
Live-Cell Imaging
Microscopy Museum
Virtual Microscopy
Web Resources
License Info
Image Use
Custom Photos
Site Info
Contact Us

The Galleries:

Photo Gallery
Silicon Zoo
Chip Shots
DNA Gallery
Amino Acids
Religion Collection
Cocktail Collection
Screen Savers
Win Wallpaper
Mac Wallpaper
Movie Gallery

Top Hat Filter

The top hat filter is based on neighborhood ranking, but it uses the ranked value from two different size regions. The brightest value in a circular interior region is compared to the brightest value in a surrounding annular region. If the brightness difference exceeds a threshold level, it is kept (otherwise it is erased). This interactive Java tutorial illustrates the application of a top hat filter to isolate details in an image.

Interactive Java Tutorial
Our servers have detected that your web browser does not have the Java Virtual Machine installed or it is not functioning properly. Please install this software in order to view our interactive Java tutorials. You may download the necessary software by clicking on the "Get It Now" button below.


The tutorial initializes with a randomly selected specimen appearing in the Specimen Image window. The Choose A Specimen pull-down menu provides a selection of specimen images, in addition to the initial randomly chosen one. The Filtering Mode buttons select whether to keep pixels that are Bright or Dark compared to their surroundings. The Neighborhood Radius slider adjusts the size of the interior region used in the top hat comparison (the outer or annular region is one or two pixels wide). The Threshold slider controls the difference between the brightest or darkest pixel value in the interior and surrounding regions that must be exceeded for the pixel to be retained, to produce the resulting Filtered Image shown on the right.

If the interior and annular regions are drawn as shown in the diagram in Figure 1, the reason for the filter name becomes apparent. The interior region is the crown and the threshold is its height, while the surrounding annulus is the brim of the hat. This operation is particularly well suited for finding the spikes in Fourier transform power spectra.

Contributing Authors

John C. Russ - Materials Science and Engineering Dept., North Carolina State University, Raleigh, North Carolina, 27695.

Matthew Parry-Hill, and Michael W. Davidson - National High Magnetic Field Laboratory, 1800 East Paul Dirac Dr., The Florida State University, Tallahassee, Florida, 32310.



Questions or comments? Send us an email.
© 1998-2009 by Michael W. Davidson, John Russ, Olympus America Inc., and The Florida State University. All Rights Reserved. No images, graphics, scripts, or applets may be reproduced or used in any manner without permission from the copyright holders. Use of this website means you agree to all of the Legal Terms and Conditions set forth by the owners.
This website is maintained by our
Graphics & Web Programming Team
in collaboration with Optical Microscopy at the
National High Magnetic Field Laboratory.
Last modification: Friday, Nov 13, 2015 at 01:19 PM
Access Count Since July 20, 2006: 13561
For more information on microscope manufacturers,
use the buttons below to navigate to their websites: