The Image Processing and Analysis Cookbook

paradepetAI and Robotics

Nov 5, 2013 (6 years and 7 months ago)


Roadmap guide to image analysis using Photoshop and the Plug-ins
The process of image analysis - obtaining meaningful numeric information
from images - typically requires several steps performed in sequence. Using
Photoshop (or a compatible program) with the plug-ins provides all of the
necessary tools but it is important for the user to understand them and when
to use them. The following roadmap offers a condensed guide to the most
common procedures. In the great majority of typical situations, this roadmap
should cover the required steps.
The Image Processing
and Analysis Cookbook
Follow this guide in order, selecting only those steps that apply to your
particular images. For instance, for a grey scale image you would skip the
steps that pertain to color images; for images with good, uniform contrast
you would skip steps that correct nonuniform illumination, adjust contrast,
or increase local contrast; etc. For each topic, there are references to the
portion of the tutorial that shows specific application of the corresponding
methods, including step-by-step use of the plug-ins and examples of the
results with representative images.
A Hands-on Companion Tutorial
1. The Photoshop environment
Photoshop-compatible Plug-ins
A. Image acquisition, storage and printing
Devices (cameras, scanners, etc.)
Parts 1.A and 1.B of the tutorial describes various issues
related to acquisition. Also refer to the Photoshop manual and
those for your hardware.
File types (avoid lossy compression), image modes
Part 4.I illustrates the problems associated with file
compression. The Photoshop manual describes the various
file types that can be used.
Printing hardcopy
Photoshop and your system and printer-specific drivers offer
a variety of choices for printing with dye-sub, ink jet, and
laser printers.
John C. Russ
© Copyright 1996-2001. All Rights Reserved
B. Basic image display
Reindeer Graphics, Inc.
Managing multiple image windows
20 Battery Park Av., Suite 502
The ÒfrontmostÓ or selected image window is always the one
being processed. You can click on the window or choose it
under the Windows menu. Undo and the History palette allow
you to step backwards through previous states.
Asheville, NC 28801
The Ò2nd ImageÓ buffer used by the plug-ins
Some operations require two images. Copy one image to a
buffer using the 2nd Image->Setup plug-in and then select the
Tutorial Introduction Page # 1 Overview
image to be processed. The buffer image is not modified. Part
1.A.3.b explains this in detail.
Are the features small in one dimension?
Rank-based leveling (2.E.8) allows creation of a background
for removal.C. Photoshop tools
Selection using ROI and wand tools Selecting background regions manually for fitting and removal
The marquee (rectangular or elliptical region of interest)
lasso, polygon and wand selection tools are explained in the
Photoshop manual. Some measurement plug-ins require that
the selected region be rectangular, and the FFT routines
require that they have specific dimensions (see Part 4.A).
This is a two-step operation shown in Part 2.E.9
Correcting varying contrast across an image
Particularly applicable to sections of varying thickness, this is
illustrated in 2.E.7.
When to subtract or divide by background
Drawing on and labeling images As shown in 2.E.3, this depends on whether the acquisition
device is linear or log.The built-in Photoshop tools for adding text, lines and other
labels are described in the Photoshop manuals.D. Expanding image contrast
Pen and background colors Linear expansion for grey scale and color images
Some plug-ins use the pen colors to define features to count
(7.A.1) or marks to threshold (5.B.2), color filters to apply
(1.C.3), and labeling features (8.C.2).
Discussed in Part 1.D.2.
Non-linear adjustments (gamma, equalization)
Discussed in Part 2.A.3.
2. Correction of image defects Negative images
A. Color images Discussed in Part 2.A.4.
Is color correction required?E. Distorted or foreshortened images
Part 1.D shows several ways to adjust colors, either manually
and automatically.
Stretching to make pixels square
Discussed in Part 2.F.
Color filtering and separation to improve contrast Perspective distortion (non perpendicular viewpoint)
Discussed in Parts 1.C.2 and 1.C.3 .Discussed in Part 2.G.
Reduction from color to greyscale 3. Enhancement of image detail
Remove the color saturation, change the image mode, or use
the plug-in procedure in Part 1.C.4 to produce a monochrome
A. Poor local contrast and faint boundaries or detail
Local equalization
Discussed in Part 3.A.
B. Noisy images Sharpening (high pass filters)
Random speckle noise - smoothing vs. median filters Part 3.C.1 discusses classical sharpening operations (e.g., the
Laplacian). The equivalent FFT based functions are shown in
Part 2.B shows smoothing and 2.C shows median filtering
Shot noise (black and/or white spots) removal Unsharp mask and difference of Gaussians
The median filter (Part 2.C) is generally preferred for this.Photoshop includes a basic unsharp mask operation. The
method is discussed in Part 3.C.5. The Difference of
Gaussians (3.C.4) is superior for noisy images.
Periodic noise removal with an FFT
Discussed in Parts 4.C and 4.H.
Scan line noise removal with a hit-or-miss median B. Are feature edges important?
Discussed in Part 2.C.7 .Edge enhancement with derivative operators
C. Nonuniform image illumination A variety of methods range from the simple Sobel (3.D.1) to
more advanced techniques like the Frei and Chen (3.D.2).
The more general topic of convolution filters is discussed in
Parts 3.C.1 to 3.C.3.
Is background visible throughout the image?
Automatic leveling based on either a bright or dark
background (2.E.6) is fast and applies to gradual brightness
variations typical of nonuniform illumination.
Tutorial Introduction Page # 2 Overview
Subtracting a rank image to reveal locally brighter or darker
features and edges
Selecting the appropriate technique from those described in
5.A.2 and 5.A.3 is based on prior knowledge (e.g., that
boundaries should be smooth).This is a very flexible technique discussed in Parts 3.D.3 -
3.D.5.B. Color images
Increasing edge sharpness and region uniformity Select a color range using the eyedropper
Several methods are compared in 3.B.1.Discussed in Part 5.B.2.
C. Converting texture and directionality to grey scale or color
Select an HSI range using the color histogram
Discussed in Part 5.B.3.
In many images, structures are discernible visually based on
textural rather than brightness of color differences.
Techniques discussed in 3.E and 3.G convert these variations
to brightness for thresholding.
C. Marking features manually
Marking the image with lines or points in a unique pen color
allows thresholding to count or measure the marks, providing
useful manual measurement tools. Part 8.G shows an
example.D. Fourier processing
Isolating periodic structures or signals 5. Binary image processing
The FFT power spectrum can facilitate the selection of
structures in the image (4.E) and their measurement (4.D).
A. Removing extraneous lines, points or other features
Erosion/dilation with appropriate coefficients to remove lines or
pointsLocation of specific features
Cross-correlation with a target image (4.F) is a powerful
object finder.
Part 6.A illustrates the use of combinations of erosion,
dilation, opening and closing for very selective correction of
binary image detail.Deconvolution to improve resolution
With a measured point-spread function, image resolution can
be increased (4.G).
EDM based opening to remove small features or protrusions\
Erosion+dilation based on the Euclidean distance map (6.B)
is much faster and more isotropic than traditional pixel-based
E. Visual enhancement using pseudo-color (Cluts), pseudo-3D, and
other tools
Discussed in Parts 1.D.5 and 1.D.6.EDM based closing to fill in gaps
F. Detecting image differences Dilation+erosion using the Euclidean distance map (6.B) fills
in gaps while retaining the shape of complex features.Alignment
The Photoshop manual describes the use of layers, which can
be shifted and rotated to align multiple images or serial
B. Separating features that touch
The watershed (6.C) is a powerful tool for separating
touching convex shapes.
Subtraction C. Combining multiple images of the same area to select features
Part 3.F discusses all aspects of image subtraction and
ratioing to reveal differences and combine multiple signals.
Boolean AND to apply multiple criteria
For different colors, or images thresholded and processed
differently, Part 6.F shows how to use Boolean logic to
combine the information.
4. Thresholding of image features
A. Thresholding using the histogram
Manual settings Boolean Feature-AND to use markers to select objects
Interactive setting of thresholds can be used to produce binary
(5.A.2 and 5.A.3) and contour (5.E.1) images. The Photoshop
selection tools can also be used, as discussed in the
Photoshop manual.
Unlike the conventional pixel-based logic, this tool selects
entire features based on markers in a second image (Part 6.J).
Region outlines as selection criteria
Outlines and boundaries are important markers to find
adjacent features (6.H).Automatic methods
D. Feature skeletons provide important shape characterization
Tutorial Introduction Page # 3 Overview
Grain boundary, cell wall, fiber images E. Measuring features on a white background
Broad thresholded lines can be thinned to single pixel width
retaining the topological information (Part 6.D).
Labeling and coloring features
Discussed in Part 8.D.
Prune to retain only the continuous tesselations and loops Feature selection based on one or more criteria
Grain boundaries and cell walls form tesselations without end
points (6.D.2).
Discussed in Parts 8.C.2
Removing small or edge-touching features
Skel+Cutoff to select portions based on length Discussed in Part 8.I.
Removal or measurement of short branches provides a
powerful tool (6.D.3).
Correction for edge-touching features
Discussed in Part 8.C1.
Measuring total skeleton length, number of ends, number of
Graphical reports of size distribution and correlation
Discussed in Part 8.F.
Part 6.D.1 shows using these values for basic topological
Exporting data
The plug-ins provide a complete output of measurement data
in a form readable by Excel and many other analysis
programs (Part 8.D).
E. Using the Euclidean Distance Map
Distances from boundaries or objects
Assigning values from the EDM to features enables the
selection or measurement of feature position relative to
irregular boundaries (Part 6.I.1).
7. Automation and batch processing using Actions
All of the plug-ins fully support Photoshop Actions, which
provides for automation and batch processing of images.
App. 5 shows several representative examples.6. Measurements
A. Calibration
Calibrating image dimensions How to use this guide
Discussed in Part 8.C.
Calibrating density/greyscale values Hands-on experimenting with the various algorithms discussed in The Image
Processing Handbook (CRC Press, Boca Raton FL, Third Edition, 1998) and
in workshops such as the Image Analysis Short Courses taught each May at
North Carolina State University and each June at the Danish Technological
Institute is an essential way to learn how the various processes work and
when they should be used. It is important to develop the userÕs experience
and judgment by the process of observing the effects of the various steps on
different images. This leads to the ability to select appropriate techniques to
extract the required information from images that require processing. The
key seems to lie in becoming aware of what it is in the image that allows the
viewer to ÒseeÓ the desired information and separate it from its
surroundings. Sometimes this involves differences in brightness, but in many
cases it is color (hue) differences, texture differences, the presence of edge
boundaries, or other subtle information. Once that identification is made, it
is usually possible to find an appropriate computer algorithm, or a
combination of them, that will isolate and measure the details of interest.
There are a number of different measurements that can be made, and it is
important to understand what they are and how the resulting data may be
related to the structures of interest. This is particularly true when the images
originate from microscopy applications, since the two-dimensional images
Discussed in Part 8.B.1.
B. Stereological measurements
Volume fraction using the histogram, pixel counting, or grids
Discussed in Part 7.A.2.
Length and Surface area - selecting the appropriate grid
Discussed in Part 7.A.
Measurement templates
Discussed in Part 7.B.
Manual marking and counting
Discussed in Parts 7.A and 8.G.
Automatic counting with grids
Discussed in Part 7.A.1.
Anisotropy and gradients
Discussed in Parts 7.C and 7.D.
C. Intensity Profiles
Discussed in Part 8.A.
D. Counting features
Correcting for features that touch the image boundaries
Discussed in Part 8.D.
Tutorial Introduction Page # 4 Overview
represent sections through three-dimensional structures. These are the
subjects of the book, the courses and of this tutorial.
functions plus some additional ones for 8 bit greyscale and 24 bit RGB color
images, while also providing the same capability for 16 bit greyscale and 48
bit RGB color images. At the present time, only Photoshop versions 5 and 6,
and Image Pro Plus version 4.1 offer full support for these deeper images,
which are obtained from some flat bed scanners, digital cameras, and
instruments such as scanned probe microscopes. The Fovea Pro plug-ins can
be installed in any of the other programs that accept Photoshop plug-ins but
will only be able to operate on 8/24 bit images in that case. In most instances
the user interface for 16/48 bit images is identical to that for 8/24 bit images;
the few differences (e.g., in threshold setting) are noted in Appendix 6.
A barrier to the hands-on practice that develops these skills lies in the wide
variety of software packages (both commercial and free) that are available,
and the fact that they run on quite different platforms (Unix, Mac, Windows,
etc.). None of these programs is truly complete in all areas of algorithms and
applications, and in addition they have very different user interface
conventions for selecting the operations that are offered. The same process
may exist with different names and means of selection in two different
programs, while others may use the same name to describe quite different
operations or measurements.This tutorial is written primarily from the standpoint of the Photoshop user,
but with a few minor adjustments applies to many other compatible
programs as well. The principal difference is that plug-ins appear in
Photoshop under the Filter menu, so that the menu selection is (e.g.) Filter
-> IP¥Process -> Kirsch. In Digital Darkroom (for example) the Filter menu
has a submenu Plug-ins under which the Tool Kit plug-ins are listed, so that
the same function would be selected as Filter -> Plug-ins -> IP¥Process ->
Kirsch. In Image Pro Plus, the Filter Plugins selection at the bottom of the
Processing menu displays a separate sub-menu of the plug-in functions. In
addition, some other programs do not have all of the built-in functions
provided in Photoshop, such as displaying the image histogram, separating
color channels, and various image adjustments. Hence, we have written
plug-ins that provide these functions. In the tutorial, there are a few sections
where built-in Photoshop functions are discussed followed by the relevant
similar operations using the plug-ins. Finally, Photoshop provides the
capability to create Actions, which are sequences of operations that provide
limited automation (see Appendix 5). Other programs do not have this
As a useful tutorial introduction to image processing and analysis that can be
used on either MacOS or Windows platforms in completely identical
environments, we have chosen Adobe Photoshop
as a host program. This
program offers the same exact menus and naming conventions for functions
on both platforms. In its basic form, Photoshop is not a comprehensive
image processing and measurement package. Indeed, its principal thrust is
toward imaging applications such as the graphic arts that are quite different
from the quantitative measurement and interpretation processes discussed
here. However, the program is already widely used in professional imaging
laboratories in routine applications such as image labeling and printing.
Moreover, it supports a wide variety of file formats and acquisition devices,
handles details of image display and system access, and provides for the use
of separately compiled Òplug-inÓ programs that can be written to extend its
functionality. We have taken advantage of this facility to create a set of
plug-ins that give Photoshop a comprehensive set of the image processing
and measurement operations found in quite high-end packages. In fact, some
professional scientific image analysis programs support the same plug-in
interface as defined by Adobe for Photoshop, and can also make use of these
plug-ins to provide functionality that may otherwise be missing.
The Tool Kit or Fovea Pro plug-ins do not really turn Photoshop into an all-
purpose high-performance scientific image analysis program, although our
experience suggests that many users of such programs also use Photoshop
for various image presentation purposes and perhaps also for image
acquisition. Photoshop provides image acquisition from an extraordinarily
broad range of devices - video and still cameras, flat bed and slide scanners,
and so forth. Because of their virtual memory schemes and the fact that they
are written using a general purpose program shell, Photoshop and other
similar programs used with the plug-ins are not very fast programs nor ones
that can be easily scripted or automated (Photoshop Actions can be used for
automation of the functions and for batch processing, but interfacing
hardware to control microscope stages, filter wheels, cameras, etc., is not
The Image Processing Tool Kit plug-ins will function with Adobe
Photoshop as well as a wide variety of host programs that support the same
plug-in interface. A few of the programs that are widely used and offer this
capability are: Digital Darkroom, Paint Shop Pro, Image Pro Plus, Canvas,
DeBabelizer, and Photodeluxe (see below for details). Other programs that
support part of the interface and can be used with most of the plug-ins
include NIH-Image. See Appendix 1 for details of installing the plug-ins
with other programs (and refer as needed to the individual program manuals
as well). Fovea Pro is a superset of the Tool Kit. It provides all of the same
Tutorial Introduction Page # 5 Overview
very practical). Nevertheless, the capabilities provided by these plug-ins are
not limited in any way to tutorial use. They are faithful and complete
implementations of the various methods described in The Image Processing
Handbook, and in addition to the examples shown here can be used on your
own images for additional training and familiarization.
1.A.2. Averaging video
1.A.3. Estimating noise content.
1.A.3.a. Subtraction.
1.A.3.b. Autoscaled subtraction
1.B. Scanners
1.C. Grey scale and color images on disk
It is expected that you will independently develop a basic facility with the
Photoshop program itself. Some of the built-in functions that are important
for scientific image analysis are covered in this tutorial where they fit in
functionally with the various plug-in routines. Basic operations such as
opening and saving files, printing images, etc., are not covered here. Nor are
those functions of the host programs that are primarily appropriate for
graphic arts and other similar applications that lie beyond the scope of this
tutorial (e.g., labeling images with text and markers). In addition to the
documentation that is supplied by Adobe with the Photoshop software, there
are numerous other sources of support and information, including books and
internet-based resources. For the latter, you can find a frequently updated list
of sites on our web page at
1.C.1. Discarding and selecting color
1.C.2. Other color spaces
1.C.3. Color separations
1.C.4. Converting Color to Grey
1.C.5. Merging planes
1.C.6. Color plane insertion
1. D. Adjustment of images
1.D.1. Color Images
1.D.2. Greyscale images
1.D.3. Flexible curves
1.D.4. Histogram equalization
1.D.5. Pseudo-colors 1.D.6. Surface rendering
This site also has information about updates to the plug-ins and tutorial,
which can be downloaded and installed to use along with the ones you have
installed from the CD-ROM.
1.E. Image resolution
1.F. Surface images
1.F.1. Stereo views
1.F.2. Color lookup tables (CLUTs)
The plug-ins discussed here are accessed by the program when they are
placed in the ÒPlug-InsÓ folder or directory belonging to Photoshop, and
appear under the ÒFilterÓ menu item. See the information in Appendix 1
describing installation for more details for either the MacOS or Windows
version. Refer as necessary to your instruction manual(s) to see where the
plug-ins should be installed for other programs.
Part 2 - Processing to correct defects
2.A. Contrast adjustment
2.A.1. Histogram analysis
2.A.2. Color Histograms
2.A.3. Histogram modification
2.A.4. Inverting contrast
2.A.5. Pseudo-color
The use of the various image processing and analysis procedures provided
by the plug-ins and by the built-in Photoshop functions is organized by
topic, following essentially the same sequence as in The Image Analysis
Handbook, 3rd Edition (J. C. Russ, 1998, CRC Press, Boca Raton FL) for
which the Image Processing Tool Kit and Fovea Pro are intended to be a
companion. There are separate documents that describe and illustrate these
procedures in detail (Part 1 through Part 8).
2.B. Smoothing
2.B.1. Noise in images
2.B.2. Blur functions
2.B.3. Specifying kernels
2.B.4. Gaussian blur
2.B.5. Convolution with disk files
2.B.6. Conditional smoothing
2.C. Median filtering
Contents 2.C.1. Despeckle function
Part 1 - Image Acquisition and Display 2.C.2. Median operator
1.A. Acquisition plug-ins 2.C.3. Plug-in median
1.A.1. Adjusting and acquiring 2.C.4. Hybrid median
Tutorial Introduction Page # 6 Overview
2.C.5. Color median 3.F.2. Color differences
2.C.6. Generalized rank operator 3.F.3. Motion differences
2.C.7. Arbitrary neighborhood shape 3.F.4. Combining images
2.D. Defect removal 3.F.5. Ratio displays
2.E. Background leveling 3.F.6. Best Focus
2.E.1. Subtracting an acquired image 3.G. Orientation
2.E.2. Subtract with autoscaling Part 4 - Frequency space processing
2.E.3. Leveling by division 4.A. FFT requirements
2.E.4. Ratioing to an internal background 4.B. Applying high and low pass filters
2.E.5. Extreme smoothing 4.B.1. Inverting filters
2.E.6. Automatic leveling 4.B.2. Avoiding ringing
2.E.7. Autocontrast 4.C. Periodic noise removal
2.E.8. Rank operation for background fitting 4.C.1. In-place operation
2.E.9. Selecting background regions 4.C.2. Periodic signals
2.F. Non-square pixels 4.D. Measurements on the power spectrum
2.F.1. Image size adjustment 4.E. Averaging periodic signals
2.F.2. Pixelsquarer 4.E.1. Processing for peak finding
2.F.3. Image rotation 4.E.2. Filters for regular lattices
2.G. General image distortion 4.E.3. Color images
2.G.1. Perspective (foreshortening) correction 4.F. Correlation
Part 3 - Processing for image enhancement 4.F.1. Cross-correlation
3.A. Histogram modification 4.F.2. Autocorrelation
3.A.1. Selected Regions 4.G. Convolution and Deconvolution
3.A.2. Local Equalization 4.H. Halftone and moir removal
3.B. Posterization 4.H.1. Color images
3.B.1. Boundary sharpening 4.I. JPEG compression
3.C. Derivatives 4.J. The linear Hough transform
3.C.1. Sharpening 4.J.1. Measurements in Hough space
3.C.2. Custom filters Part 5 - Thresholding and segmentation
3.C.3. Convolution with disk files 5.A. Grey scale images
3.C.4. Difference of Gaussians 5.A.1. Photoshop Threshold function
3.C.5. Unsharp Mask 5.A.2. Bilevel thresholding
3.C.6. General Gaussian filter 5.A.3. Selecting a range of values
3.D. Advanced Edge Finding 5.B. Color images
3.D.1. Gradient operators 5.B.1. Combining planes
3.D.2. Variance and Frei & Chen 5.B.2. Selecting a color range
3.D.3. Range operator 5.B.3. Working in H-S-I space
3.D.4. Top Hat 5.B.4. Other segmentation tools
3.D.5. Grey scale Open and Close 5.C. Region growing
3.E. Texture 5.C.1. Select similar, select inverse
3.F. Image arithmetic 5.D. Processing to isolate structures
3.F.1. Subtraction 5.D.1. Grain boundaries
Tutorial Introduction Page # 7 Overview
5.D.2. Edge enhancement 7.A.5. Number per unit volume
5.D.3. Texture 7.A.6. Advanced stereology
5.D.4. Orientation 7.B. Measurement templates
5.D.4.a. Lookup table modification 7.C. Orientation
5.D.4.b. Measuring the orientation 7.D. Clustering
5.D.5. Gaussian smoothing 7.E. Colocalization
5.E. Contours Part 8 - Feature-specific measurements
5.E.1. Manual selection 8.A. Intensity profiles
Part 6 - Binary image processing 8.B. Density measurements
6.A. Erosion, Dilation, Opening, Closing 8.B.1. Calibrated density
6.A.1. Removing lines 8.B.2. Cluster counting
6.A.2. Filling gaps 8.C. Measurement of features
6.A.3. Removing noise 8.C.1. Feature-specific parameters
6.A.4. Anisotropy 8.C.1.a. Measures of size
6.B. The Euclidean Distance Map 8.C.1.b. Measures of shape
6.B.1. Erosion, Dilation, Opening, Closing 8.C.1.c. Skeleton-based measurements
6.C. Watershed segmentation 8.C.1.d. Measures of intensity
6.C.1. Ultimate Points 8.C.1.e. Measures of color
6.D. Skeletonization 8.C.1.f. Measures of position
6.D.1. End and branch points 8.C.1.g. Other parameters
6.D.2. Network images (thickening and pruning) 8.C.1.h. Precision and accuracy
6.D.3. Skeleton cutoff (removing branches with end points)8.C.2. Selection
6.D.4. The skiz (skeleton of the background) 8.D. Saving the measurement data
6.E. Seed growth (masked dilation) 8.D.1. Labeling
6.F. Boolean operations 8.D.2. Color by value
6.F.1. Multiple planes 8.E. Measuring other properties
6.F.2. Features within regions 8.F. Data analysis
6.F.3. Color images 8.G. Manual measurement
6.G. Filling holes 8.H. Testing algorithms
6.H. Adjacency 8.I. Edge effects and dirt
6.H.1. Touching boundaries 8.J. Section unfolding
6.I. Distance selection 8.J.1. Spreadsheets and data analysis
6.I.1. Distance measurement 8.K. Fiber images
6.J. Feature-AND 8.L. Measurement of location
Part 7 - Stereology and global properties 8.M. Manual measurements
7.A. Manual stereology 8.N. Reading numeric data from graphs
7.A.1. Stereological calculations Appendix 1 - Installation and overview
7.A.1.a. Automatic counting with grids Appendix 2 - List of Images
7.A.2. Metric properties Appendix 3 - Stereology
7.A.2.a. Reference areas Appendix 4 - Surface measurement
7.A.3. Grain size Appendix 5 - Actions and automation
7.A.4. Measurement in volumes Appendix 6 - 16 bit grey scale and 48 bit RGB color images
Tutorial Introduction Page # 8 Overview
Appendix 7 - Feature Classification The Layers capability of Photoshop 4, 5 and 6 is very useful in other ways,
such as allowing you to keep the original image as the background, duplicate
the layer for processing (perhaps several times for multi-step operations),
and then adjust the visibility of the layers to see what the various operations
have done. That capability is not shown in these examples, but the plugins
operate correctly with layers and will process whichever layer is currently
active. Images with multiple layers are saved as Photoshop *.psd (Windows)
or Ò8BPSÓ (Macintosh) files.
The use of the various procedures is illustrated here using the images stored
on the CD-ROM, although it is also possible (and recommended) to use your
own images to better develop familiarity with the effects of the algorithms
on images of particular interest. The images are stored as TIFF files on both
the Macintosh and Windows partitions of the CD (with a few exceptions
noted). Appendix 2 lists the images present (the names have been shortened
to fit the Windows 8.3 naming convention). Most other image analysis
programs can read this widely used format as well. General-purpose image
format translators such as DeBabelizer (and numerous shareware programs)
are widely available to convert other less common images formats to one
that can be read, if it is required to handle your own images and the host
program does not provide that capability. Photoshop can also open files
using a ÒRawÓ mode that allows you to open nearly any format provided that
you know how the data are arranged in the file. Fovea Pro includes the
capability to read several specialized scientific imaging formats, such as the
atomic force microscope images saved by Digital Instruments Nanoscopes,
confocal microscope images saved by BioRad, and SDF or surface data
format files used by several scanned stylus instruments (see Appendix 6).
By default, the plug-ins operate on the entire image. If a region has been
selected (using Photoshop's marquee tool, freehand drawing tool, or magic
wand) most of the plug-ins will operate only on the pixels within the
selection (which may consist of several disconnected parts). There are
exceptions, primarily in the measurement routines, because some of the
operations require a rectangular image (either the entire image or a
rectangular selection region); when applied with an irregular region of
interest they will actually process the portion of the image within the
bounding rectangle around the defined region. Most of the Fourier
processing routines require a rectangular image whose dimensions in pixels
are powers of 2 (128, 256, 512, 1024, etc.). The Setup 2nd Image routine
always saves the pixels in a rectangular region that surrounds any irregular
region that has been selected. In all these cases there are reminder or
warning dialogs presented to the user.
The tutorial shows the actual appearance of the images as the various
operations are performed, as well as the menus, dialogs and results as they
appear on the screen. The user interface that you see may vary slightly from
these illustrations depending on your computer and operating system, but the
essentials of the menus, dialogs and formatting remain the same. The menu
illustrations correspond to Photoshop 5.0; in a few cases there are minor
variations in placement of commands between these programs; for example,
converting an RGB Color image to a greyscale monochrome image is
accomplished in Photoshop 3 by Mode -> Greyscale and in Photoshop 4
and 5 by Image -> Mode -> Greyscale (the entire Mode menu in Photoshop
3 was made a submenu under the Image menu in Photoshop 4). A few of the
procedures, such as manual drawing in layers for measurement, are
dependent upon the layers capability of Photoshop 4, 5 and 6. The History
palette in Photoshop 5 and 6 is a wonderful tutorial tool (as well as being an
important aid in other work and an unlimited Undo buffer), but is not
emphasized in the examples shown. Using Undo/Redo to view the changes
made by a processing step is strongly recommended. While the specific
illustrations in the tutorial are for Photoshop 5 and 6, it is not expected that
users having a basic familiarity with other host programs will encounter
Sections 7 and 8 of the tutorial are primarily concerned with image
measurements. In many cases the data obtained from the images can be
straightforwardly interpreted to yield the desired information, but this is not
always the case. One particular situation in which care is needed is for
images obtained from various kinds of microscopes (electron, light, etc.), in
which the specimen may be a slice (thin section or cut surface) through a
three-dimensional structure. The values measured on the two-dimensional
image are related to the parameters of the three-dimensional structure, but
some calculation and conversion is required. The same situation can arise in
other, more macroscopic fields of application such as industrial quality
control or medical X-rays or tomography.
The scientific and mathematical field that deals with the relationships
between 2D images (either sections or projections) and the 3D images which
they represent is Stereology. This tutorial does not deal with the
mathematical or conceptual underpinnings of stereology, although many of
Tutorial Introduction Page # 9 Overview
the measurements performed in sections 7 and 8 are correct and appropriate
for stereological use. As an aid to the user of the tutorial and the plug-ins in
Fovea Pro and Image Processing Tool Kit, Appendix 3 provides a brief
overview of stereology procedures. For more detail, we recommend: J. C.
Russ and R. T. Dehoff, Practical Stereology, Second Edition, Plenum Press,
New York, 2001, isbn 0-306-46476-4.
Photoshop LE and Elements (Mac and Win) - All plug-ins work correctly,
but can only be applied to 8 bit per channel images (even the Fovea Pro
plug-ins that work properly with 16 bit per channel images under Photoshop
5 and 6).
Digital Darkroom 1.0 and 1.2 (Mac and Win) - All plug-ins work correctly
(version 1.2 is required for WinNT and recommended for all users) except
that some plug-ins with preview dialogs do not function properly in Digital
Darkroom for the Macintosh. The files must reside in the Plug-ins folder
within the DDStuff folder (on the Mac you can use an alias with that name
to the actual folder containing the plug-ins).
There are many other programs that support Photoshop-compatible plug-ins.
Most of these can use the Image Processing Tool Kit plug-ins, and can use
Fovea Pro plug-ins for 8 bit grey scale and 24 bit RGB color images. In
some cases the plug-ins are not organized into sub-menus according to the
function groups and names built into the ÒPiPLÓ resource that is included in
the plug-in files. These older-style programs recognize the plug-ins by their
folder location and file type, but list them alphabetically by file name. You
can change the file names as desired to create some order and organization
in the menu (this will not affect the menu names in Photoshop, which uses
the menu entry inside the resource in each plug-in file). Some of these
programs also limit the total number of plug-ins that can be listed in the
menus, so it may be necessary to choose which ones to place in the directory
that the program scans.
Canvas 5 (Mac and Win) - All plug-ins work correctly. Set preferences to
direct Canvas to the directory where your filters are stored (like Photoshop,
the program correctly searches for plug-ins in subfolders and shows them in
a hierarchical menu). Execution speed of some plug-ins is significantly
slower than in Photoshop possibly due to disk caching or layer handling
DeBabelizer (Mac and Win) - All plug-ins work correctly. Set preferences
to the folder in which the Photoshop filters are stored. Sub-folders/sub-
directories are NOT searched for plug-ins, but Mac aliases are followed. The
menu lists plug-ins alphabetically by file name under "Other."
Testing of the plug-ins with a variety of programs that claim to support
Photoshop plug-ins has produced the following observations (note in all
cases the version levels that were tested - earlier or later versions may be
different). We do NOT guarantee or warrant the plug-ins for use with any of
these other programs, nor that our testing will keep up with changes and
revisions in these programs. We would welcome additional information
from users who may have tested them with other programs on either Mac or
Windows platforms (email
NIH Image 1.62b16 (Mac) - All plug-ins work correctly except those that
deal specifically with 24 bit color images (which are not passed to the plug-
ins using the conventions of the Photoshop plug-in interface). Plug-ins must
be placed in the programÕs Plug-ins folder (no aliases can be used) and are
listed alphabetically in a single menu by their file names, not the menu
names used by Photoshop. Only the 68K code is run (the faster PPC code
present in the plug-ins is ignored). The PC version of Image (Scion Image)
and the Java version (Image/J) do not at this time support Photoshop-
compatible plug-ins.Photoshop (Mac and Win) - All plug-ins work correctly in Photoshop 3.x,
4.x, 5.x and 6.x under Mac System 7.x and 8.x and under Windows 95, 98,
ME, 2K and NT4. They should also run correctly under Photoshop 3 or 4
with Windows 3.1 and NT 3.51, although they have not been exhaustively
tested in those environments. On the Mac, the plug-ins contain native code
for both 680x0 and PPC processors; Photoshop 5.x and 6 run only on the
PPC. The Fovea Pro plug-ins correctly support 16 bit greyscale and 48 bit
RGB color images when used with Photoshop 5, 5.5 or 6.0.
Color-It 3.0 and 3.2 (Mac) - All plug-ins work correctly. Requires filters (or
aliases) to be placed in the program's own Plug-ins folder (no subfolders are
searched). Plug-ins are listed alphabetically under "Other".
ImageTool 1.27 and 2.0 (Win) - Plug-ins for 8 bit grey scale images work
correctly; they appear hierarchically under the Processing menu. The
program requires at least Windows 95 or NT4. It creates a new image
Tutorial Introduction Page # 10 Overview
window for each processing step and so does not support or require "undo"
Plug-in Organization
When you have installed the plug-ins and launched
Photoshop, you will find that under the Filters menu
there are a series of entries added to whatever may
already have been there (your menu may have
additional functions and groups of functions besides
those shown here). The plug-in groups that start with
the designation IP¥ (Mac) or IP* (Windows) are the
ones provided on the CD and covered in this tutorial.
Each one has a submenu that lists the individual
routines within that class of operations. The listings in
each menu and submenu are alphabetical. Under
Photoshop 4, 5 and 6 the third-party added plug-in
categories appear after the built-in filters in the menu
listing, separated by a horizontal line.
Enhance 3.0 (Mac) - Plug-ins for 8 bit grey scale images work correctly
when they or their aliases are placed in the program's own Plug-ins folder.
Plug-ins are listed alphabetically.
HotShot 1.5 (Mac and Win) - Plug-ins work correctly when they are placed
in the programs own Plug-ins folder (Mac aliases are not followed, and sub-
folders are not searched).
PhotoDeluxe (Mac and Win) - All plug-ins work correctly under Mac
System 7.x and 8.x, Windows 95 and NT. Because all images are treated as
24 bit color multilayer arrays the plug-ins operate more slowly than in
Image Pro Plus 4.1 (Win) - All plug-ins work correctly including the Fovea
routines for 16 bit greyscale and 48 bit RGB images. The Image Pro Plus
convention that features are white and background is black is the opposite of
all other programs listed here; it may be helpful to invert images when using
the plug-ins. There is no equivalent in Image Pro Plus to the Photoshop
foreground and background colors, which are always interpreted as black
and white respectively. Plug-ins apply to the entire image, ignoring any area
of interest that may be set; to restrict operation to a region, use the Edit ->
Duplicate function to copy the selected region to a separate image. Scripts
can invoke plug-ins but cannot pass values to them.
A brief summary of the plug-ins by class and function is given below. In the
body of the tutorial the focus is on what the various operations are used for,
rather than a concise listing of what they are and what each one does.
The surface analysis (IP¥Surfaces) sub-menu and the utilities sub-menu
(IP¥Utilities) are only installed with Fovea Pro. Their contents are described
in Appendices 4, 5 and 6.
IP¥2nd Image
Hardcopy Many of the plug-in functions require access to two images.
All of the Math and Boolean operations fall into this
category, and so do some others such as the Hough transform
and the surface rendering routines.
The total extent of the tutorial (this introduction, eight parts, plus
appendices) is about 240 double pages. Most of the pages include graphics,
and many have color images on them. For many users it will be most
convenient to browse through these sections on the computer screen. For
anyone wishing to print them, a few notes will save considerable frustration.
The pages have been formatted for reading on a computer screen, with very
narrow margins. Printing these pages on standard US 8-1/2 x 11 inch letter
size paper may result in clipping at the margins with some printers. The
problem may be considerably worse with narrower European A4 letter size
paper. If this problem is present with your printer, the best solution is to set
the printer driver to reduction so that the document is printed at about 90%
of its original size. This will allow it to fit comfortably on either size paper.
The individual function descriptions indicate that one image is to be
designated the "second" image for these operations, and when this is done
the image is copied into a buffer where those routines that require a second
image can access it. This buffer is not modified in the process, and the same
second image can be used repeatedly until Setup 2nd Image is selected to
copy a different image. The Setup function is used often and so is duplicated
under the IP¥Boolean and IP¥Math menus for convenience. These selections
are identical and any of them can be used interchangeably. The Recall
function brings back the stored second image. Swap interchanges the
contents of the current front image and the stored image.
Tutorial Introduction Page # 11 Overview
If the current image and the second image have different dimensions, the
common upper left corner is used. If they have different color modes or bit
depths (Fovea Pro supports both 8 bit and 16 bit per channel images) the
conversion is performed automatically. For instance, using Setup 2nd Image
on an RGB color image, and then Recall 2nd Image with grey scale window,
will convert the image to grey scale. Note that this provides a way to convert
a 16 bit image to an 8 bit image by exact division, rather than using the built-
in Photoshop conversion which dithers the 8 bit image (use Setup on the 16
bit image, convert the image mode to 8 bit or create a new image, and select
For color images, the hue and saturation of pixels are preserved. The Auto
button sets the limits so that 1/2% of the pixels are clipped to black and to
Rotate provides horizontal and vertical scaling as well as arbitrary rotation
of the image (with or without bilinear interpolation). Perspective correction
requires that the user mark four points on the image in a unique foreground
color, which define the corners of a rectangular region that has been
distorted by perspective. The program calculates the trapezoidal distortion
produced and removes it, producing a rectified image.
The Adjust menu covers routines that modify the
acquired image to correct defects such as shading
(nonuniform illumination) and point of view.
Align shifts the image in X and Y to achieve a best
alignment with the stored 2nd image. Autolevel adjusts
the brightness across the image by using a polynomial fit
for background brightness as a function of X, Y
position, which is automatically determined based on the
assumption that the brightest (Autolevel Bright) or
darkest (Autolevel Dark) phase present should be the
same everywhere.
Boolean functions are described primarily in Part 6.
They are used to combine binary images using various
logical combinations. Most of these are pixel-by-pixel
methods that define the resulting pixel value as black or
white depending on the values of the pixel in two
original images, but one (Feature-AND) bases the
comparison on entire features (contiguous sets of
pixels) in the two images.
Except for NOT (which inverts an image, interchanging black for white),
these functions require two images. The procedure is to bring one image to
the front and use the Setup 2nd Image selection. This will store a copy the
image internally so that it can be used in the subsequent Boolean operation.
Then bring the primary image to the front and select the desired function.
The primary image will be modified accordingly. The second image, stored
in its buffer memory, is not affected in any way. The same second image can
be re-used as many times as you wish until you replace it with a different
image. It is not even necessary that the second image still be open on the
The program divides the image into a 9x9 grid, finds the brightest or darkest
point in each rectangle, and fits a polynomial to the 81 points (rejecting
statistical outliers). This function is then subtracted from the image to level
the overall contrast. Autocontrast constructs both the bright and dark
polynomial functions and scales each part of the image between them.
AutoLevelColor applies the same polynomial fit to the hue values in the
image. Fit Background uses all of the pixels in selected regions to fit a
polynomial background, which can then be removed from the entire image
using Remove Bkgnd.
All of these two image operations are most meaningful when both images
are of the same size. If they are not, only the common rectangle at the upper
left corner is processed. If the secondary image is not of the same mode (bit
depth and color) as the primary image, conversion is automatically supplied.
Using the Boolean Functions AND, OR, and Exclusive OR, plus NOT to
invert either of the two original images and/or the final result, provides
complete flexibility for image combination.
Equalization modifies pixel brightnesses to produce a uniform histogram in
which all brightness levels are used equally (for linear equalization). This
corresponds to a linear cumulative histogram. Modified histograms with
bright or dark emphasis, or center or extreme emphasis can also be selected.
Contrast allows you to set limits on the brightness values in the histogram
and linearly scale the pixel values between those black and white end points.
Tutorial Introduction Page # 12 Overview
Feature-And keeps entire features if any part of the feature overlaps a
feature in the second image. Mask keeps the original grey scale value of any
pixel that is non-white in the second image, but erases to white any pixels
that are white in the second image. This is particularly useful for measuring
the density or color of features (which are defined as contiguous groups of
non-white pixels).
The Color Filter function applies an arbitrary color filter to an image or
allows separating an image into RGB or HSI planes. The Optimal Grey
reduction of a color image produces a monochromatic grey scale along an
axis in RGB space that gives the greatest mathematical separation of the
color coordinate values for the particular image.
Match Hue rotates the hue wheel to match two selected regions (usually in
different images). Tristimulus allows you to enter sensitivity coefficients
for R, G and B specific to your camera which are then multiplied by the
stored Red, Green and Blue intensities to produce a corrected color image.
Normalize performs the same operation but calculates the factors based on
the assumption that areas of true red, green and blue are present in the
Photoshop contains within the basic functions many
routines for dealing with color images, and this tutorial
uses several of them. The additional functions listed
under IP¥Color will only function meaningfully on an
RGB color image. The color Median filter examines the
3x3 neighborhood of pixels around each location and
selects the pixel color values which are median in the
sense that the color coordinates have the smallest sum of
Euclidean distances to all of the neighboring pixel
coordinates. Similarly, the color Range operator creates
a greyscale image with the maximum difference between
the color coordinates of the neighborhood pixels.
Apply CLUT loads a selected CLUT file from disk and
substitutes color values for each pixel according to its
brightness (the format of these files is the same as
Photoshop's lookup tables, 768 bytes consisting of 256
sets of three bytes with the R, G, B values).
The IP¥EDM functions offer those operations that are
based on the Euclidean Distance Map of the image. The
Distance Map replaces each black (foreground) pixel in
a binary image with a grey scale value that represents
the distance of that pixel from the nearest background
(white) pixel in any direction (up to a maximum of 255).
It is useful in morphological operations such as erosion
and dilation and for the measurement of distances and is
discussed in Part 6. Ultimate Points keeps just the
maxima of the distance map, with grey values that
directly measure the size of the inscribed circles.
Color Cube displays 3D histograms of the RGB and HSI values for pixels
in the image. The faces of these cubes are sometimes called Co-occurrence
or Co-localization matrices, since they indicate where particular values of
color are found in the same location.
The Watershed function creates and uses that distance map to separate
touching convex features.
Erode, Dilate, Open and Close are the analogs of traditional or classical
morphological operations that remove or add pixels around feature
boundaries, but by thresholding the distance map rather than comparing
pixel neighbor locations. These EDM-based routines are much more
isotropic (and faster). The Set Depth command controls the distance for the
erosions and dilations, and accepts real number values since pixel distances
in arbitrary directions are not limited to integers. The value entered is
remembered in the preferences file until changed.
ColorSpace provides conversion of the RGB image data to HSL, HSV and
L¥a¥b color spaces and back (the display will appear strange when these
functions are selected because the values are still interpreted by the system
and display hardware as RGB). This is useful in Photoshop where the color
channels can then be separated as separate grey scale images. Transfer
Plane copies the selected R, G, B, H, S or I plane from the designated
second image and transfers it to the current primary image. This is an
efficient way to extract specific planes, or merge them into other images.
Tutorial Introduction Page # 13 Overview
Cutoff allows removing features that are smaller than a specified size or
which touch edges, so that accurate and unbiased measurements can be
made. Count Marks reports the number of groups (ÒblobsÓ) of pixels in
whatever the current pen color is set to, useful both for counting the results
of template measurement operations and manual marking.
Photoshop and similar programs do not contain very
many facilities for image and feature measurement
(basically just a manual ruler). These plug-ins and those
under IP¥Measure add measurement functionality with
a very complete set of global measurements (discussed
in Part 7) and feature measurements (discussed in Part
8). IP¥Measure provides the global measurements
(Global, Grain Size, Fractal Dim, Clustering,
Tangent Count) that are appropriate for stereological
descriptions of microstructure. Brightness, Histogram
and Intensity Profile access the pixel brightness values.
Calibrate provides spatial calibration and Density
Calib. provides density calibration.
The IP¥FFT functions are described in Part 4. They
provide comprehensive facilities for transforming
images to and from the Fourier or Frequency domain,
filtering it there, and retransforming it.
Forward FT calculates the FFT of the image (which
must have dimensions that are an exact power of 2, e.g.,
64, 128, 256, 512, ... pixels) and displays the power
spectrum. Inverse FT calculates the real space image
from the FFT stored by a previous transform operation
and requires that the image be the same size as the
stored power spectrum. Apply Filter uses the current
image as a multiplicative filter (sometimes called a
mask) to scale the magnitude of the FFT. It can be used
to selectively remove information corresponding to
particular frequencies and directions. The convention is
that white in the mask corresponds to zero and black to
1.0, and intermediate grey scales are treated
proportionately. Power Spectrum can be used to
redisplay the power spectrum from the stored FFT,
while Phase displays the phase information.
IP¥Features provides measurements that are concerned with the discrete
features (connected groups of pixels on a white background or selected as
regions) in the image. Measure All can be used to write disk files of data in
ascii text format which can be read for analysis by most spreadsheet and
statistical analysis programs. Data on the size, shape, position and color of
each feature (all connected or touching non-white pixels) are saved. You can
append data to an existing file, to combine measurements from a series of
images (of course, you can also append the data to any text file but the
results will generally not be useful in that case!). Regions performs the same
measurement function for pixels within selected regions, created with the
marquee, drawing or wand tools.
Label identifies the features by labeling them (using the current foreground
and background colors) in the image with either the feature number or the
numerical value of any measured parameter. Color by Value assigns colors
or grey scale values to each feature proportional to the magnitude of any
selected measurement parameter (after which they can be thresholded).
Distribution and Plot create graphic displays of selected measurement
parameters. Select presents a graphical representation of the size and shape
data, and allows specification of a range of size and shape parameters for
features to be kept (features outside the entered range are set to grey so they
can be removed by thresholding). Classification (Fovea Pro only) allows
specifying a file name containing the various class definitions for feature
labeling (see Appendix 7).
Filter & Inverse applies the mask or filter from the current image and then
performs the inverse transform in a single step (the stored transform is not
altered). Symmetry allows you to mark the power spectrum image (e.g.,
with a paint brush tool) to locate specific spikes or other features, and then
duplicate one half of the power spectrum onto both halves (keeping
whichever pixel value is darker). Harmonics allows you to mark one or two
points that correspond to the innermost points of a regular pattern (this is
particularly useful with diffraction patterns encountered in electron
microscopy) and will complete the rest of the pattern.
Generate Filters provides facilities for generating symmetrical high or low
frequency masks. An Ideal inverse filter linearly attenuates low frequencies
Tutorial Introduction Page # 14 Overview
and emphasized high frequencies. The Hamming filter also attenuates high
frequencies to reduce noise. The Butterworth filter (second order)
attenuates low frequencies at an adjustable cutoff limit (corresponding to
50% attenuation). Remember that inverting an image to interchange black
and white converts a high frequency to a low frequency filter or vice-versa.
Annular (range of frequencies) or Sector (range of directions) masks can
also be generated. The Bandpass filter generates a symmetrical filter with
weighting that can be set by adjusting sliders at various frequencies.
Intensity Inverse reverses the intensity value while
leaving hue and saturation unchanged, while Saturate
keeps the hue and lightness unchanged and maximizes
the saturation of each pixel. Make All Opaque is are
intended to deal specifically with layers in Photoshop
images, setting all transparent pixels to the background
Sine Function creates a sinusoidal pattern of lines that
can be added to other surfaces, and Random creates a
random grey scale (either uniform or Gaussian) that can
be added to other images to simulate noise. Fractal
Values produces values that vary with fractal geometry
and can be used as a range image for a fractal surface.
Profile displays show log (magnitude) profiles across the power spectrum at
any selected angle or averaged over all directions. Show FT Values displays
the real and imaginary values at any point, as well as the spacing and
orientation that corresponds to the location.
Cross-Correlate combines two images (the first one must first be
designated using the Setup2nd Image function) by multiplying the complex
FT images together, to produce a magnitude map of the fit. When the same
image is correlated with itself, it is called Autocorrelation. Convolution uses
the second image as a blur function to modify the primary image, and
Deconvolution uses it as a blur function to remove from the primary image.
All of these functions accept images that need not be the same size, nor a
power of 2 (they are automatically padded to the next larger power of two
Fill Region replaces the pixel values within any selected rectangular or
arbitrary region with black, white, linear ramps, the foreground pen color, by
extrapolation from the region edges, or the average value of the pixels within
that area. The latter is a particularly effective way of reducing a complex
image to a set of uniform regions; filling with black or white may be useful
in programs other than Photoshop which do not have that function built in.
Frame Region outlines the selected region of interest.
The complex image data resulting from an FFT operation are held in a
separate temporary file and so can be used more than once, for instance by
creating different filters and using Filter + Inverse. However, Apply Filter
changes this data. Also there can only be one complex image at a time, so
performing an FFT on one image will erase any prior data stored.
Several tools are provided under this menu for dealing with images of
surfaces (range images in which grey scale represents elevation). Relief
applies a derivative filter to create an embossed appearance to the surface. If
the image is first changed to a color mode the elevation will be mapped to
hue and the slope to intensity. Phong generates a photorealistic rendering of
the surface with an adjustable light source location and specularity of the
modeled surface.
Surface Render draws a complete perspective-corrected rendering of the
image, with selections that allow displaying the slope or elevation as
brightness, or a photorealistic rendering using the product of the two values.
If the image is in RGB mode the elevation can also be mapped to hue, or a
red-cyan stereo view produced. It is also possible to turn on or off a grid of
lines on the surface, and to select the sampling interval of the data. To use
this function first use Setup 2nd Image to copy the image into memory and
then create a new blank image of whatever size is desired to hold the
rendered result.
Tutorial Introduction Page # 15 Overview
space. Then the Forward transform generates sinusoids in this image for
every black (pixel value = 0) pixel in the original image. These sinusoids
add together to produce peaks that identify linear arrangements in the
original image (the range of values is from 1 to 254). Mark the peak
crossover points as black (pixel value = 0) using the pencil tool or with
image processing tools such as a top hat and thresholding. Use Setup 2nd
Image to designate the Hough space image and return to the original image.
Select the Inverse transform to draw lines on the original showing the
alignments that correspond to the black pixels in the Hough space.
A separate set of plug-in functions for the processing and measurement of
surface range images (e.g. from scanned probe microscopes or interference
microscopes) can be optionally installed, appears under the IP¥Surfaces
menu, discussed in Appendix 4.
This menu includes several types of routines that deal
with lines and points in images. One class of functions
draws various lines which are used for stereological
measurements or as grids that are combined with images
using Boolean operations to permit measurement or
counting of intersections. Line Grids generates a variety
of circle and line grids, Parallel draws arrays of
horizontal, vertical or angled lines, Radial draws an array
of either uniformly spaced or sine-weighted radial lines,
Cycloid draws an array of cycloidal arcs, and Point
Grids generates arrays of points, all superimposed on the
image in the current pen color. Counting Grid produces
a specialized grid for unbiased counting of features in
areas. The use of measurement grids is discussed in detail
in Part 7.
The IP¥Math routines provide ways to combine two
grey scale images together. In addition to the basic
arithmetic operations (Add, Divide, Multiply,
Subtract), it is possible to keep the Lighter or Darker
pixel value at each location. Blend combines two
images in any amount (as specified by the user),
whereas Add combines them equally. Absolute
Difference performs an absolute value subtraction.
General (Fovea Pro only) provides a complete general
purpose math package with options for autoscaling and
offsets, primarily important for images with calibrated
density values.
Line Profile plots (and saves to disk) the intensity or color information
along a line between any two user-marked points. The routine leaves a line
in the current pen color on the image to mark the location measured. This is
particularly useful since you can append a line profile to an existing disk
file, in which case the distance column will start over for each segment
(easily added in a spreadsheet program). Magnif. Bar draws a magnification
bar in the lower right corner of the image and labels it according to the
calibration in effect.
Best Focus combines the two images keeping whichever pixel has the
greater value of local variance. This is a non-linear implementation much
like a high-pass filter that responds to sharp focus, and allows combining
images at different focal depths to construct an extended focus composite.
Like the Boolean operations, these use two images and so there is a selection
to setup the second image (which is not altered in the process) before
selecting the main image and performing the desired operation. This "Setup
2nd Image" selection is identical to the one under the IP¥Boolean menu and
the Setup selection under IP¥2nd Image, and they can be used
interchangeably. An image stored with either one is used by both the math
and Boolean functions.
Centroids marks the location of the center of each feature in a binary image.
Point I'cepts uses the array of points stored using Setup 2nd Image to
measure the mean cubed intercept lengths (see the discussion in Part 7).
These points may be the centroids or a grid of points, depending on the type
of measurement desired.
Image math operations are used throughout the tutorial and are discussed
primarily in Parts 2 and 3. The math operations all operate internally using
extended precision and automatically scale the resulting image to the full
available grey scale range of the display.
The Hough transform is a tool for finding linear arrays of features within
images. It is discussed in Part 4. First use Setup 2nd Image to indicate the
starting image. Select or create a new image of any size to be the Hough
Tutorial Introduction Page # 16 Overview
relationship between brightness (luminance) and some calibrated value such
as dosage or optical density. Again, multiple files can be saved on disk for
re-use as desired.As noted above under IP¥Features, Photoshop does not
contain very many facilities for image and feature
measurement. These plug-ins and those above add that
functionality with a very complete set of global
measurements (discussed in Part 7) and feature
measurements (discussed in Part 8). The global
measurements are appropriate for stereological
descriptions of microstructure and for measurements,
often using grid templates generated using plug-ins under
the IP¥Points+Lines menu.
Morphological operations on black and white (binary)
images add or remove pixels from features depending
on whether the neighbor pixels are black or white. They
are discussed in Part 6. On color or grey scale images
they treat any non-white pixel (i.e., and value less than
255) as part of a feature.
Erode and Dilate are the basic removal and addition
routines, while Open and Close perform the same
operations in pairs.
Global measurement reports the area fraction, specific surface area and
mean intercept length of structures. Grain Size reports the ASTM grain size
(actually a measure of the surface area of grain boundary per unit volume).
Tangent Count reports the positive and negative tangent count on the
image, from which the connectivity of structures and curvature of
boundaries can be determined. Clustering reports statistics on the mean
nearest neighbor distance between feature centroids, which discriminate
between clustered, random and spaced feature arrangements. Fractal Dim
reports the fractal dimension of boundaries (based on the Euclidean distance
map of the non-white pixels). Total Length estimates the length of irregular
lines and for the particular cases of skeletonization counts the number of
ends and nodes; it assumes that the image has already been reduced to lines
by an appropriate morphological operation such as skeletonizing or
The Parameters selection allows entering the number of repetitions and
neighbor criteria for action (the number of adjacent pixels of the opposite
color that must be exceeded before pixel black/white reversal takes place).
Setting the coefficient to zero corresponds to ÒclassicalÓ erosion and
dilation. Note that the IP¥EDM menu provides a more isotropic set of
erosion/dilation tools, and the IP¥Rank menu provides tools that work with
greyscale images.
Outline keeps only the outer hull or custer of features, while Skeletonize
removes all pixels except those which form the midline and contain basic
topological information about feature shape (it also codes the end points to
200 and nodes to 125 for subsequent counting or removal). Prune removes
branches from the skeleton that have end points. Skel+Cutoff allows
selecting a branch length (in pixels) so that all shorter branches that have an
end point are shaded grey for removal by thresholding. Thicken converts a
standard 8-connected skeleton to a 4-connected path that can separate the
pixels on either side from touching. Fill Holes fills in regions enclosed
entirely within features.
Brightness measures the mean brightness, the mean red, green and blue
values, and the calibrated density for all pixels in a selected region. The
Colocalize function plots intensity pairs for any two images (one must first
be placed into the second image buffer using Setup 2nd Image). Histogram
and Intensity Profile also access the pixel values and both display the
results and write disk files. Orientation is a specialized form of Histogram
that plots 0..180 or 0.. 360 degree distributions of values from the Sobel
direction operator, when it is used to determine orientations within an image.
Seed Growth iteratively dilates features within the area defined by nonwhite
pixels in the designated second image, but will not merge features that
initially have a different grey scale value. The use of this function is shown
in Part 6.
Calibrate is used to establish the units and dimension for size
measurements. This value is stored in the preferences file. The established
value remains in use until changed, and disk files with standard calibration
values can be kept for later use. Density Calibration is used to establish a
Tutorial Introduction Page # 17 Overview
to interactively enter kernel weights, with a live preview. Unlike the
Photoshop custom filter, it accepts floating point values and can autoscale
the results.Photoshop contains several image processing facilities,
but these plug-ins add those features not present in the
host program that are particularly useful in technical
applications. Processing is discussed in Parts 2 and 3,
and is normally used to correct image defects, enhance
visibility of selected structures, or extract characteristics
such as texture or orientation so that thresholding can be
used to separate features from background.
Frei & Chen, Kirsch, Sobel Magnitude, Stoch. Edge
and Variance are edge enhancement filters. The Kirsch
function applies a 3x3 derivative in each possible
direction and keeps the maximum value. The Sobel
routine calculates the square root of the sum of squares
of two orthogonal 3x3 derivatives. The stochastic edge
routine is like the Sobel but uses a 3x3, 5x5 or 7x7
neighborhood and weights the pixels according to their
Gaussian Blur applies Gaussian smoothing., and Diff. Gauss. provides
unsharp mask and difference-of-Gaussians operations. The standard
deviations of the Gaussians are entered in pixel distances.
Local Equalization performs contrast equalization in a circular
neighborhood with adjustable size, and replaces the value of the central
pixel, repeating the operation for every pixel in the image. Adaptive
Equalization is a more flexible version of this operation that also provides
interactive settings for noise rejection, contrast expansion, and center
weighting of the neighborhood region. Equalize Variance increases local
contrast in smooth areas, with interactive setting of neighborhood size.
Extremum and Kuwahara are step-sharpening operators: Extremum is a
3x3 filter that keeps either the max or min value, whichever is closest to the
mean; Kuwahara (also known as Mean of Least Variance) is a 5x5 filter that
compares 3x3 subfields and keeps the mean of the region with the smallest
variance.The Frei and Chen combines the results from multiple 3x3 processing
kernels to distinguish between edges and point noise or lines. The variance
calculates the statistical variation of the pixels within an adjustable size
neighborhood (from 1 to 3.9 pixel radius).
The Olympic filter is a composite linear and ranking filter that ranks the
pixel values in a 3x3 neighborhood, discards the two extreme values and
returns the mean of the remaining 7. Conditional smooth weights pixels in
the neighborhood according to their distance and grey scale difference from
the central pixel, reducing edge blurring. Sharpen is a modified Laplacian
operator that is less sensitive to the magnitude of pixel values.
Haralick 1 and 2, Entropy and Texture are texture filters, and Variance
may also serve that function in some images. The Texture operator computes
a local Hurst fractal dimension. The Haralick operators return the entropy
and second moment of the pixel grey scale values.
When applied to color images, the processing operations act on the pixel
intensity values and leave the color content (hue and saturation) of pixels
unchanged, except for the Sobel magnitude (which operates on the R, G, B
planes individually) and direction (which suppresses the color information).
The Sobel Direction function is an orientation sensitive filter. It encodes the
orientation angle of the vector of the maximum brightness gradient with
values from 0 to 255 representing angles from 0 to 360 degrees. The
calculation uses the same 3x3 derivatives as the Sobel edge finding operator
and uses the Arc Tangent function to determine the angle from the
magnitude of the two vectors.
Convolve allows the user to apply multiplicative filters like the built-in
Custom filter in Photoshop but larger (up to 95x95) by loading the
coefficients (either integer or real values) from a standard ascii text file. The
values should be arranged on lines, separated by space, tab or comma, and
must be square with an odd dimension. Custom is similar but allows the user
Tutorial Introduction Page # 18 Overview
can be thresholded to select values that are brighter or darker than their
surroundings. The Rolling Ball filter uses the same logic to find pixels in the
inner circle whose values lie outside the extremes (brightest and darkest) of
the larger neighborhood and replace them with the mean of the outside, as a
noise rejection tool.
Rank operators are nonlinear image processing filters
that rank the pixels in a neighborhood (for most of these,
a 5 pixel wide circle) in brightness order and then keep
the Brightest, Darkest or Median value for the central
pixel. Photoshop also provides its own maximum
(brightest) and minimum (darkest) rank filters under
Other and its own median filter under Noise, and these
have a slider that allows selecting the size of the
neighborhood (which is square) in pixels.
The Darkest and Brightest operations function as a grey
scale dilation and erosion, and can be combined into
Opening and Closing sequences (opening is brightest
followed by darkest and closing is the opposite) with the
number of Iterations selected (the number of , e.g.,
brightest operations followed by the same number of
darkest operations in an opening).
Thinning sets pixels to white if they have neighbors that are darker. This is
primarily used to thin edges from various edge-finding processes (e.g.,
Sobel, Kirsch) to single-pixel width, and is the grey-scale analog to
morphological skeletonization.
Rank processing is discussed in Parts 2 and 3.
The plug-in routines for processing surface range
images and measuring them are discussed in detail in
Appendix 4. The plug-ins with prefix Meas provide
measurement capabilities. These include classical
roughness parameters for areas and elevation profiles,
as well as fractal dimension. The Meas-Stereo routine
uses two images (one in the second image buffer) to
calculate elevation from disparity.
The Reconstruction routine combines an image of the
surface with the range image to show a rendered,
realistic visualization of the surface.
The Adjustable rank operator allows the user to set the size of the
neighborhood as selected which value to take from the rank-order listing of
pixels. The HitOrMiss operator allows you to select specific neighbor pixels
to construct an arbitrary shape neighborhood (when applied to a black and
white image, this becomes the classical morphological hit-or-miss operator).
For color images, these functions select pixels based on their brightness but
retain the color values. The Color Rank operator selects pixels based on
maximum or minimum intensity of a selected color.
The plug-ins with prefix Proc provide image processing capability for range
images, including generating stereo views (viewable with red-blue or red-
green glasses), marking the highest peaks and lowest valleys, removing tilt
and curvature, and reducing noise without rounding corners.
Range is a texture and edge extraction filter that keeps the difference
between the brightest and darkest values. Hybrid Median preserves corners
better than isotropic rank operators. It ranks the pixel values in subgroups
and then ranks the median values from each partial result. Orient. Median
performs a 3x3 median specifically intended for direction images (e.g., from
the Sobel direction operator), which takes into account the discontinuity at
360 degrees.
The Top Hat filter measures the difference between the darkest and
brightest pixel values in a small (adjustable) circle with the extreme values
present in a larger (adjustable) annular one, leaving the difference in a new
image. Values that are not outside the envelope of the larger neighborhood
are set to 128, and local bright and dark features are highlighted. This image
Tutorial Introduction Page # 19 Overview
Thresholding is discussed in Part 5. Note that when the Fovea Pro plug-ins
are used with 16 bit per channel images, the interactive user dialogs for
BiLevel, Color Mapping, and Thresh. Levels allow expansion of the
histogram to show all of the grey levels (values between the integer 0..255
levels). This is illustrated and discussed in more detail in Appendix 6.
Photoshop offers a manual bi-level thresholding operator
that separates dark from light pixels as the user slides a
cursor across the histogram. These plug-ins offer
additional functionality to select an arbitrary intermediate
slice of brightness values, either manually with a
scrollable visual preview or with automatic assistance
according to several algorithms. BiLevel provides a
single threshold setting to separate light from dark
regions, while Thresh Levels provides two settings that
can be used to select any range of values.
These routines, which are only present in Fovea Pro, do
not modify the stored image, although like all plug-ins
they do require one to be open in order to select the
function. Conversion of images stored in other formats
to the Photoshop Ò.psdÓ native format is discussed in
Appendix 6.
The BiLevel routine provides an Auto button that applies a statistical test to
separate the pixels into two groups with the maximum difference; it is useful
for images such as printing on paper that consists of exactly two populations
of pixel values. The Thresh Levels routine provides a similar routine
(button "3") for the case of three populations of pixels. It also has "M"
(minimum) "A" (area) and "P" (perimeter) buttons that modify the slider
settings by up to ±15 grey levels to locate points that are the local minima in
the histogram, cause the least change in feature areas, or the least change in
feature perimeters. Color Mapping is identical to thresholding levels,
except that the selected pixels are set to the foreground pen color and the
other pixels are left unchanged.
Show Values provides an easy way to read the pixel values from an image,
in R, G, B or greyscale and calibrated density.
Logging is useful with Actions to record values from the various plug-ins
that report numeric results. Each output value is logged to the file selected in
Setup Log File, with a description. Use the Log Next Line function in your
action to advance the file to the next line and write a time/date stamp into it.
The resulting file can be read with any word processor, or with a data
analysis program such as Excel. See Appendix 5.
Setup Recipe File allows selecting a file for classification. The format for
these files is shown in Appendix 7.
Color Range selects pixels close to the current foreground color, with
ranges of hue, saturation and intensity as specified by the user (use the
eyedropper tool to select the foreground color from the image beforehand).
Pencolor is useful to create a binary image from hand-drawn lines, making
pixels that match the pen (within ±5 levels in each R, G, B color) are set to
black and all others to white. When the pencolor is set to black, this is also a
fast way to eliminate any non-black pixels from an image. Percent allows
the user to specify the area fraction of dark or bright pixels; this is of use
with surface images, after edge enhancement, and also for images such as
FFT power spectra. Thresh HSI allows interactive selection of pixels by
hue-saturation-intensity values.
Register is used to enter the product serial number, as discussed in
Appendix 1.
Contour provides a boundary delineation tool by drawing a line that
separates brighter from darker pixels, and IsoLines draws families of such
lines. Skeleton is specifically designed for selecting portions (segments,
nodes or ends) from skeletons produced using the Morphology routines.
Tutorial Introduction Page # 20 Overview
Part 1. Acquisition and Display opportunity to compare the image quality produced by different cameras
and scan rates. Video cameras generally sacrifice quality (pixel noise,
uniformity, dynamic range) in order to provide Òreal timeÓ frame rates (i.e.
25 or 30 frames per second), which may not be required in many
applications; averaging of multiple frames, if it is available in a particular
digitizer, can improve image quality. Video cameras often exhibit different
noise characteristics on the left and right side of the image because of
readout effects. The choice of composite, component (also known as S-
video) or RGB connections can significantly affect resolution as well as
color consistency and accuracy.
1.A. Acquisition plug-ins
1.A.1. Adjusting and acquiring
1.A.2. Averaging video
1.A.3. Estimating noise content.
1.A.3.a. Subtraction.
1.A.3.b. Autoscaled subtraction
1.B. Scanners
1.C. Grey scale and color images on disk
1.C.1. Discarding and selecting color
1.C.2. Other color spaces Digital cameras can integrate the signal for a longer time, but exposures
over about 1/2 second often show increased noise because of thermal
effects unless they are cooled. Flat bed scanners offer extremely high
resolution and dynamic range when photographs are encountered. Use the
various cameras and scanners that may be available to compare image
quality. The characteristics of the image acquisition device used strongly
influence the needs for various processing algorithms to correct defects.
1.C.3. Color separations
1.C.4. Converting color to grey
1.C.5. Merging planes
1.C.6. Color plane transfer
1. D. Adjustment of images
1.D.1. Color Images
1.D.2. Greyscale images
1.D.3. Flexible curves A few devices may have dedicated acquisition programs rather than
providing a Photoshop plug-in; these will generally allow you to save the
image in various formats, and we recommend that you use PICT or TIFF
on the Mac or .TIF under Windows, so that you can then load the images
from disk into Photoshop or any of the program packages you may wish to
use. It is recommended that you do NOT use lossy compression formats
such as JPEG, which as shown below can alter image contents and distort
boundaries and colors. Some programs open only uncompressed TIFF files,
so avoid the use of LZW compression even though it does not alter image