100% found this document useful (2 votes)
43 views65 pages

MATLAB Image Processing Toolbox User S Guide The Mathworks - The Latest Ebook Edition With All Chapters Is Now Available

The document is a guide for the MATLAB Image Processing Toolbox, detailing its features, configuration, and usage instructions. It includes links to various MATLAB toolbox user guides and provides information on how to download the eBooks. Additionally, it contains contact information for MathWorks and a revision history of the guide.

Uploaded by

luukkomsaod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
43 views65 pages

MATLAB Image Processing Toolbox User S Guide The Mathworks - The Latest Ebook Edition With All Chapters Is Now Available

The document is a guide for the MATLAB Image Processing Toolbox, detailing its features, configuration, and usage instructions. It includes links to various MATLAB toolbox user guides and provides information on how to download the eBooks. Additionally, it contains contact information for MathWorks and a revision history of the guide.

Uploaded by

luukkomsaod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Explore the full ebook collection and download it now at textbookfull.

com

MATLAB Image Processing Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-image-processing-
toolbox-user-s-guide-the-mathworks/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

MATLAB Signal Processing Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-signal-processing-toolbox-
user-s-guide-the-mathworks/

textbookfull.com

MATLAB Econometrics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-econometrics-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Bioinformatics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-bioinformatics-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Mapping Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-mapping-toolbox-user-s-guide-
the-mathworks/

textbookfull.com
MATLAB Optimization Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-optimization-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Trading Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-trading-toolbox-user-s-guide-
the-mathworks/

textbookfull.com

MATLAB Computer Vision Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-computer-vision-toolbox-user-
s-guide-the-mathworks/

textbookfull.com

MATLAB Curve Fitting Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-curve-fitting-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Fuzzy Logic Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-fuzzy-logic-toolbox-user-s-
guide-the-mathworks/

textbookfull.com
Image Processing Toolbox™
User's Guide

R2020a
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Image Processing Toolbox™User's Guide
© COPYRIGHT 1993–2020 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
August 1993 First printing Version 1
May 1997 Second printing Version 2
April 2001 Third printing Revised for Version 3.0
June 2001 Online only Revised for Version 3.1 (Release 12.1)
July 2002 Online only Revised for Version 3.2 (Release 13)
May 2003 Fourth printing Revised for Version 4.0 (Release 13.0.1)
September 2003 Online only Revised for Version 4.1 (Release 13.SP1)
June 2004 Online only Revised for Version 4.2 (Release 14)
August 2004 Online only Revised for Version 5.0 (Release 14+)
October 2004 Fifth printing Revised for Version 5.0.1 (Release 14SP1)
March 2005 Online only Revised for Version 5.0.2 (Release 14SP2)
September 2005 Online only Revised for Version 5.1 (Release 14SP3)
March 2006 Online only Revised for Version 5.2 (Release 2006a)
September 2006 Online only Revised for Version 5.3 (Release 2006b)
March 2007 Online only Revised for Version 5.4 (Release 2007a)
September 2007 Online only Revised for Version 6.0 (Release 2007b)
March 2008 Online only Revised for Version 6.1 (Release 2008a)
October 2008 Online only Revised for Version 6.2 (Release 2008b)
March 2009 Online only Revised for Version 6.3 (Release 2009a)
September 2009 Online only Revised for Version 6.4 (Release 2009b)
March 2010 Online only Revised for Version 7.0 (Release 2010a)
September 2010 Online only Revised for Version 7.1 (Release 2010b)
April 2011 Online only Revised for Version 7.2 (Release 2011a)
September 2011 Online only Revised for Version 7.3 (Release 2011b)
March 2012 Online only Revised for Version 8.0 (Release 2012a)
September 2012 Online only Revised for Version 8.1 (Release 2012b)
March 2013 Online only Revised for Version 8.2 (Release 2013a)
September 2013 Online only Revised for Version 8.3 (Release 2013b)
March 2014 Online only Revised for Version 9.0 (Release 2014a)
October 2014 Online only Revised for Version 9.1 (Release 2014b)
March 2015 Online only Revised for Version 9.2 (Release 2015a)
September 2015 Online only Revised for Version 9.3 (Release 2015b)
March 2016 Online only Revised for Version 9.4 (Release 2016a)
September 2016 Online only Revised for Version 9.5 (Release 2016b)
March 2017 Online only Revised for Version 10.0 (Release 2017a)
September 2017 Online only Revised for Version 10.1 (Release 2017b)
March 2018 Online only Revised for Version 10.2 (Release 2018a)
September 2018 Online only Revised for Version 10.3 (Release 2018b)
March 2019 Online only Revised for Version 10.4 (Release 2019a)
September 2019 Online only Revised for Version 11.0 (Release 2019b)
March 2020 Online only Revised for Version 11.1 (Release 2020a)
Contents

Getting Started
1
Image Processing Toolbox Product Description . . . . . . . . . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2

Configuration Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

Compilability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4

Basic Image Import, Processing, and Export . . . . . . . . . . . . . . . . . . . . . . . 1-5

Correct Nonuniform Illumination and Analyze Foreground Objects . . . . 1-10

Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18


Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Image Processing Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
MATLAB Newsgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19

Introduction
2
Images in MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

Image Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3


Pixel Indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Spatial Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

Define World Coordinates Using XData and YData Properties . . . . . . . . . 2-6


Display an Image using Nondefault Spatial Coordinates . . . . . . . . . . . . . . 2-6

Define World Coordinates Using Spatial Referencing . . . . . . . . . . . . . . . . 2-9

Image Types in the Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11


Binary Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Indexed Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Grayscale Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Truecolor Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
HDR Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Multispectral and Hyperspectral Images . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Label Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16

v
Display Separated Color Channels of RGB Image . . . . . . . . . . . . . . . . . . . 2-17

Convert Between Image Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20

Convert Image Data Between Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21


Overview of Image Class Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Losing Information in Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Converting Indexed Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21

Perform an Operation on a Sequence of Images . . . . . . . . . . . . . . . . . . . 2-22

Detecting Cars in a Video of Traffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24

Process Folder of Images Using Image Batch Processor App . . . . . . . . . 2-30

Process Large Set of Images Using MapReduce Framework and Hadoop


......................................................... 2-38

Work with Image Sequences as Multidimensional Arrays . . . . . . . . . . . . 2-48


Create Multidimensional Array Representing Image Sequence . . . . . . . . 2-48
Display Image Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-48
Process Image Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-49

Image Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-51

Image Arithmetic Clipping Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-52

Nest Calls to Image Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . 2-53

Find Vegetation in a Multispectral Image . . . . . . . . . . . . . . . . . . . . . . . . . 2-54

Reading and Writing Image Data


3
Get Information About Graphics Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

Read Image Data into the Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

Read Multiple Images from a Single Graphics File . . . . . . . . . . . . . . . . . . 3-5

Read and Write 1-Bit Binary Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6

Write Image Data to File in Graphics Format . . . . . . . . . . . . . . . . . . . . . . . 3-7

Determine Storage Class of Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8

DICOM Support in Image Processing Toolbox . . . . . . . . . . . . . . . . . . . . . . 3-9

Read Metadata from DICOM Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10


Private DICOM Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Create Your Own Copy of DICOM Dictionary . . . . . . . . . . . . . . . . . . . . . . 3-11

vi Contents
Read Image Data from DICOM Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
View DICOM Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12

Write Image Data to DICOM Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13


Include Metadata with Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13

Explicit Versus Implicit VR Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14

Remove Confidential Information from a DICOM File . . . . . . . . . . . . . . . 3-15

Create New DICOM Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16

Mayo Analyze 7.5 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18

Interfile Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19

Work with High Dynamic Range Images . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20


Read HDR Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Display and Process HDR Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20
Create High Dynamic Range Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Write High Dynamic Range Image to File . . . . . . . . . . . . . . . . . . . . . . . . 3-21

Display High Dynamic Range Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22

Displaying and Exploring Images


4
Image Display and Exploration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

Display an Image in a Figure Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Specifying the Initial Image Magnification . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Controlling the Appearance of the Figure . . . . . . . . . . . . . . . . . . . . . . . . . 4-5

Display Multiple Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7


Display Multiple Images in Separate Figure Windows . . . . . . . . . . . . . . . . 4-7
Display Multiple Images in a Montage . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Display Images Individually in the Same Figure . . . . . . . . . . . . . . . . . . . . 4-9
Compare a Pair of Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10

View Thumbnails of Images in Folder or Datastore . . . . . . . . . . . . . . . . . 4-11

Interact with Images Using Image Viewer App . . . . . . . . . . . . . . . . . . . . . 4-17


Open Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Initial Image Magnification in Image Viewer App . . . . . . . . . . . . . . . . . . 4-19
Choose Colormap Used by Image Viewer App . . . . . . . . . . . . . . . . . . . . . 4-19
Import Image Data from Workspace into Image Viewer App . . . . . . . . . . 4-20
Export Image Data from Image Viewer App to Workspace . . . . . . . . . . . . 4-21
Save Image Data Displayed in Image Viewer . . . . . . . . . . . . . . . . . . . . . . 4-22
Close the Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22
Print Images Displayed in Image Viewer App . . . . . . . . . . . . . . . . . . . . . 4-23

vii
Explore Images with Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Explore Images Using the Overview Tool . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Pan Images Displayed in Image Viewer App . . . . . . . . . . . . . . . . . . . . . . 4-25
Zoom Images in the Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Specify Image Magnification in Image Viewer . . . . . . . . . . . . . . . . . . . . . 4-26

Get Pixel Information in Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . 4-28


Determine Individual Pixel Values in Image Viewer . . . . . . . . . . . . . . . . . 4-28
Determine Pixel Values in an Image Region . . . . . . . . . . . . . . . . . . . . . . 4-29
Determine Image Display Range in Image Viewer . . . . . . . . . . . . . . . . . . 4-32

Measure Distance Between Pixels in Image Viewer App . . . . . . . . . . . . . 4-34


Determine Distance Between Pixels Using Distance Tool . . . . . . . . . . . . . 4-34
Export Endpoint and Distance Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35
Customize the Appearance of the Distance Tool . . . . . . . . . . . . . . . . . . . 4-36

Get Image Information in Image Viewer App . . . . . . . . . . . . . . . . . . . . . . 4-37

Adjust Image Contrast in Image Viewer App . . . . . . . . . . . . . . . . . . . . . . 4-39


Open the Adjust Contrast Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39
Adjust Image Contrast Using the Histogram Window . . . . . . . . . . . . . . . 4-41
Adjust Image Contrast Using Window/Level Tool . . . . . . . . . . . . . . . . . . . 4-42
Make Contrast Adjustments Permanent . . . . . . . . . . . . . . . . . . . . . . . . . 4-44

Interactive Contrast Adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46

Crop Image Using Image Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47

Explore 3-D Volumetric Data with Volume Viewer App . . . . . . . . . . . . . . 4-50


Load Volume Data into the Volume Viewer . . . . . . . . . . . . . . . . . . . . . . . 4-50
View the Volume Data in the Volume Viewer . . . . . . . . . . . . . . . . . . . . . . 4-52
Adjust View of Volume Data in Volume Viewer . . . . . . . . . . . . . . . . . . . . . 4-55
Refine the View with the Rendering Editor . . . . . . . . . . . . . . . . . . . . . . . 4-57
Save Volume Viewer Rendering and Camera Configuration Settings . . . . 4-62

Explore 3-D Labeled Volumetric Data with Volume Viewer App . . . . . . . 4-63
Load Labeled Volume and Intensity Volume into Volume Viewer . . . . . . . 4-63
View Labeled Volume in Volume Viewer . . . . . . . . . . . . . . . . . . . . . . . . . 4-65
Embed Labeled Volume with Intensity Volume . . . . . . . . . . . . . . . . . . . . 4-66

View Image Sequences in Video Viewer App . . . . . . . . . . . . . . . . . . . . . . . 4-71


View MRI Sequence Using Video Viewer App . . . . . . . . . . . . . . . . . . . . . 4-71
Configure Video Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-74
Specifying the Frame Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-75
Specify Color Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-76
Get Information about an Image Sequence . . . . . . . . . . . . . . . . . . . . . . . 4-76

Convert Multiframe Image to Movie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-78

Display Different Image Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-79


Display Indexed Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-79
Display Grayscale Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-79
Display Binary Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-81
Display Truecolor Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-82

viii Contents
Add Color Bar to Displayed Grayscale Image . . . . . . . . . . . . . . . . . . . . . . 4-84

Print Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-86


Graphics Object Properties That Impact Printing . . . . . . . . . . . . . . . . . . 4-86

Manage Display Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-87


Retrieve Values of Toolbox Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . 4-87
Set Values of Toolbox Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-87

Building GUIs with Modular Tools


5
Build Custom Image Processing Apps Using Modular Interactive Tools
.......................................................... 5-2

Interactive Modular Tool Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7


Display Target Image in Figure Window . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Associate Modular Tools with Target Image . . . . . . . . . . . . . . . . . . . . . . . 5-8
Associate Modular Tools with Particular Target Image . . . . . . . . . . . . . . . 5-9
Get Handle to Target Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Specify Parent of Modular Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
Position Modular Tools in GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
Adding Navigation Aids to GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15

Build App to Display Pixel Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19

Build App for Navigating Large Images . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21

Customize Modular Tool Interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23

Build Image Comparison Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24

Create Angle Measurement Tool Using ROI Objects . . . . . . . . . . . . . . . . 5-27

Geometric Transformations
6
Resize an Image with imresize Function . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2

Rotate an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6

Crop an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8

Translate an Image using imtranslate Function . . . . . . . . . . . . . . . . . . . . 6-10

2-D and 3-D Geometric Transformation Process Overview . . . . . . . . . . . 6-13


Create Geometric Transformation Object . . . . . . . . . . . . . . . . . . . . . . . . 6-13
Perform the Geometric Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16

ix
Matrix Representation of Geometric Transformations . . . . . . . . . . . . . . . 6-17
2-D Affine Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
2-D Projective Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
Create Composite 2-D Affine Transformations . . . . . . . . . . . . . . . . . . . . . 6-19
3-D Affine Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21

Specify Fill Values in Geometric Transformation Output . . . . . . . . . . . . . 6-23

Perform Simple 2-D Translation Transformation . . . . . . . . . . . . . . . . . . . 6-25

N-Dimensional Spatial Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29

Register Two Images Using Spatial Referencing to Enhance Display . . . 6-31

Create a Gallery of Transformed Images . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36

Exploring a Conformal Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-52

Exploring Slices from a 3-Dimensional MRI Data Set . . . . . . . . . . . . . . . 6-64

Padding and Shearing an Image Simultaneously . . . . . . . . . . . . . . . . . . . 6-71

Image Registration
7
Approaches to Registering Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Registration Estimator App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Intensity-Based Automatic Image Registration . . . . . . . . . . . . . . . . . . . . . 7-3
Control Point Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Automated Feature Detection and Matching . . . . . . . . . . . . . . . . . . . . . . . 7-5

Register Images Using Registration Estimator App . . . . . . . . . . . . . . . . . . 7-6

Load Images, Spatial Referencing Information, and Initial


Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Load Images from File or Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Provide Spatial Referencing Information . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
Provide an Initial Geometric Transformation . . . . . . . . . . . . . . . . . . . . . . 7-15

Tune Registration Settings in Registration Estimator App . . . . . . . . . . . 7-17


Geometric Transformations Supported by Registration Estimator App . . 7-17
Feature-Based Registration Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Intensity-Based Registration Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
Nonrigid and Post-Processing Settings . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18

Export Results from Registration Estimator App . . . . . . . . . . . . . . . . . . . 7-20


Export Results to the Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Generate a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20

Techniques Supported by Registration Estimator App . . . . . . . . . . . . . . . 7-22


Feature-Based Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Intensity-Based Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22

x Contents
Nonrigid Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23

Intensity-Based Automatic Image Registration . . . . . . . . . . . . . . . . . . . . 7-24

Create an Optimizer and Metric for Intensity-Based Image Registration


......................................................... 7-26

Use Phase Correlation as Preprocessing Step in Registration . . . . . . . . 7-27

Register Multimodal MRI Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32

Register Multimodal 3-D Medical Images . . . . . . . . . . . . . . . . . . . . . . . . . 7-42

Registering an Image Using Normalized Cross-Correlation . . . . . . . . . . 7-50

Control Point Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-56

Geometric Transformation Types for Control Point Registration . . . . . . 7-58

Control Point Selection Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60

Start the Control Point Selection Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-62

Find Visual Elements Common to Both Images . . . . . . . . . . . . . . . . . . . . 7-64


Use Scroll Bars to View Other Parts of an Image . . . . . . . . . . . . . . . . . . . 7-64
Use the Detail Rectangle to Change the View . . . . . . . . . . . . . . . . . . . . . 7-64
Pan the Image Displayed in the Detail Window . . . . . . . . . . . . . . . . . . . . 7-64
Zoom In and Out on an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-65
Specify the Magnification of the Images . . . . . . . . . . . . . . . . . . . . . . . . . 7-65
Lock the Relative Magnification of the Moving and Fixed Images . . . . . . 7-66

Select Matching Control Point Pairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68


Pick Control Point Pairs Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68
Use Control Point Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-69
Move Control Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-71
Delete Control Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-71

Export Control Points to the Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . 7-73

Find Image Rotation and Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75

Use Cross-Correlation to Improve Control Point Placement . . . . . . . . . . 7-79

Register Images with Projection Distortion Using Control Points . . . . . 7-80

Designing and Implementing Linear Filters for Image Data


8
What Is Image Filtering in the Spatial Domain? . . . . . . . . . . . . . . . . . . . . 8-2
Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3

xi
Integral Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5

Filter Grayscale and Truecolor (RGB) Images using imfilter Function . . . 8-7

imfilter Boundary Padding Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11

Filter Images Using Predefined Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14

Generate HDL Code for Image Sharpening . . . . . . . . . . . . . . . . . . . . . . . . 8-17

What is Guided Image Filtering? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24

Perform Flash/No-flash Denoising with Guided Filter . . . . . . . . . . . . . . . 8-25

Segment Thermographic Image after Edge-Preserving Filtering . . . . . . 8-29

Apply Multiple Filters to Integral Image . . . . . . . . . . . . . . . . . . . . . . . . . . 8-33

Reduce Noise in Image Gradients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-38

Design Linear Filters in the Frequency Domain . . . . . . . . . . . . . . . . . . . . 8-47


Two-Dimensional Finite Impulse Response (FIR) Filters . . . . . . . . . . . . . 8-47
Transform 1-D FIR Filter to 2-D FIR Filter . . . . . . . . . . . . . . . . . . . . . . . 8-47
Frequency Sampling Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-49
Windowing Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-50
Creating the Desired Frequency Response Matrix . . . . . . . . . . . . . . . . . . 8-51
Computing the Frequency Response of a Filter . . . . . . . . . . . . . . . . . . . . 8-52

Transforms
9
Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Definition of Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Discrete Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Applications of the Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8

Discrete Cosine Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12


DCT Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
The DCT Transform Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
Image Compression with the Discrete Cosine Transform . . . . . . . . . . . . . 9-13

Hough Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16


Detect Lines in Images Using Hough . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16

Radon Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21


Plot the Radon Transform of an Image . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23
Viewing the Radon Transform as an Image . . . . . . . . . . . . . . . . . . . . . . . 9-25

Detect Lines Using the Radon Transform . . . . . . . . . . . . . . . . . . . . . . . . . 9-27

xii Contents
The Inverse Radon Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32
Inverse Radon Transform Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32
Reconstructing an Image from Parallel Projection Data . . . . . . . . . . . . . . 9-34

Fan-Beam Projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-37


Image Reconstruction from Fan-Beam Projection Data . . . . . . . . . . . . . . 9-39
Reconstruct Image using Inverse Fanbeam Projection . . . . . . . . . . . . . . . 9-40

Reconstructing an Image from Projection Data . . . . . . . . . . . . . . . . . . . . 9-44

Morphological Operations
10
Types of Morphological Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Morphological Dilation and Erosion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Operations Based on Dilation and Erosion . . . . . . . . . . . . . . . . . . . . . . . 10-4

Structuring Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9


Determine the Origin of a Structuring Element . . . . . . . . . . . . . . . . . . . 10-10
Structuring Element Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11

Border Padding for Morphology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13

Morphological Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14


Understanding the Marker and Mask . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
Finding Peaks and Valleys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16

Pixel Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22


Defining Connectivity in an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22
Choosing a Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23
Specifying Custom Connectivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23

Lookup Table Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25


Creating a Lookup Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25
Using a Lookup Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25

Dilate an Image to Enlarge a Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-27

Remove Thin Lines Using Erosion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-31

Use Morphological Opening to Extract Large Image Features . . . . . . . 10-33

Flood-Fill Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38


Specifying Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38
Specifying the Starting Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38
Filling Holes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-39

Detect Cell Using Edge Detection and Morphology . . . . . . . . . . . . . . . . 10-41

Granulometry of Snowflakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-46

xiii
Distance Transform of a Binary Image . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50

Label and Measure Connected Components in a Binary Image . . . . . . 10-52


Detect Connected Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-52
Label Connected Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-53
Select Objects in a Binary Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-54
Measure Properties of Connected Components . . . . . . . . . . . . . . . . . . . 10-54

Analyzing and Enhancing Images


11
Pixel Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Determine Values of Individual Pixels in Images . . . . . . . . . . . . . . . . . . . 11-3

Intensity Profile of Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5


Create an Intensity Profile of an Image . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Create Intensity Profile of an RGB Image . . . . . . . . . . . . . . . . . . . . . . . . 11-6

Contour Plot of Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8


Create Contour Plot of Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8

Measuring Regions in Grayscale Images . . . . . . . . . . . . . . . . . . . . . . . . . 11-10

Finding the Length of a Pendulum in Motion . . . . . . . . . . . . . . . . . . . . . 11-16

Create Image Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-22

Image Mean, Standard Deviation, and Correlation Coefficient . . . . . . . 11-24

Edge Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25


Detect Edges in Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25

Boundary Tracing in Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27


Trace Boundaries of Objects in Images . . . . . . . . . . . . . . . . . . . . . . . . . 11-27
Select First Step and Direction for Tracing . . . . . . . . . . . . . . . . . . . . . . 11-30

Quadtree Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32


Perform Quadtree Decomposition on an Image . . . . . . . . . . . . . . . . . . . 11-32

Detect and Measure Circular Objects in an Image . . . . . . . . . . . . . . . . . 11-35

Identifying Round Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48

Measuring Angle of Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56

Measuring the Radius of a Roll of Tape . . . . . . . . . . . . . . . . . . . . . . . . . . 11-62

Calculate Statistical Measures of Texture . . . . . . . . . . . . . . . . . . . . . . . . 11-65

Texture Analysis Using the Gray-Level Co-Occurrence Matrix (GLCM)


........................................................ 11-67

xiv Contents
Create a Gray-Level Co-Occurrence Matrix . . . . . . . . . . . . . . . . . . . . . . . 11-68

Specify Offset Used in GLCM Calculation . . . . . . . . . . . . . . . . . . . . . . . . 11-69

Derive Statistics from GLCM and Plot Correlation . . . . . . . . . . . . . . . . . 11-70

Adjust Image Intensity Values to Specified Range . . . . . . . . . . . . . . . . . 11-72

Gamma Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-74


Specify Gamma when Adjusting Contrast . . . . . . . . . . . . . . . . . . . . . . . 11-74

Contrast Enhancement Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-76

Specify Contrast Adjustment Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-80


Specify Contast Adjustment Limits as Range . . . . . . . . . . . . . . . . . . . . 11-80
Set Image Intensity Adjustment Limits Automatically . . . . . . . . . . . . . . 11-81

Histogram Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-82


Adjust Intensity Values Using Histogram Equalization . . . . . . . . . . . . . 11-82
Plot Transformation Curve for Histogram Equalization . . . . . . . . . . . . . 11-84

Adaptive Histogram Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-86


Adjust Contrast using Adaptive Histogram Equalization . . . . . . . . . . . . 11-86

Enhance Color Separation Using Decorrelation Stretching . . . . . . . . . 11-88


Simple Decorrelation Stretching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-88
Linear Contrast Stretching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-92
Decorrelation Stretch with Linear Contrast Stretch . . . . . . . . . . . . . . . 11-92

Enhance Multispectral Color Composite Images . . . . . . . . . . . . . . . . . . 11-94

Low-Light Image Enhancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-104

Apply Gaussian Smoothing Filters to Images . . . . . . . . . . . . . . . . . . . . 11-114

Noise Removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-120


Remove Noise by Linear Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-120
Remove Noise Using an Averaging Filter and a Median Filter . . . . . . . 11-120
Remove Noise By Adaptive Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . 11-123

Compute 3-D Superpixels of Input Volumetric Intensity Image . . . . . 11-126

Image Quality Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-129


Full-Reference Quality Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-129
No-Reference Quality Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-130

Train and Use No-Reference Quality Assessment Model . . . . . . . . . . . 11-131


NIQE Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-131
BRISQUE Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-133

Obtain Local Structural Similarity Index . . . . . . . . . . . . . . . . . . . . . . . 11-135

Compare Image Quality at Various Compression Levels . . . . . . . . . . . 11-137

xv
Anatomy of Imatest Extended eSFR Chart . . . . . . . . . . . . . . . . . . . . . . 11-139
Slanted Edge Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-139
Gray Patch Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-140
Color Patch Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-141
Registration Markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-141

Evaluate Quality Metrics on eSFR Test Chart . . . . . . . . . . . . . . . . . . . . 11-143

Correct Colors Using Color Correction Matrix . . . . . . . . . . . . . . . . . . . 11-155

Install Sample Data Using Add-On Explorer . . . . . . . . . . . . . . . . . . . . . 11-162

ROI-Based Processing
12
Create a Binary Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Create a Binary Mask from a Grayscale Image . . . . . . . . . . . . . . . . . . . . 12-2
Create Binary Mask Using an ROI Function . . . . . . . . . . . . . . . . . . . . . . 12-2
Create Binary Mask Based on Color Values . . . . . . . . . . . . . . . . . . . . . . . 12-4
Create Binary Mask Without an Associated Image . . . . . . . . . . . . . . . . . 12-4

ROI Creation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5


Create ROI Using Creation Convenience Functions . . . . . . . . . . . . . . . . . 12-8
Create ROI Using draw Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-10
Using ROIs in Apps Created with App Designer . . . . . . . . . . . . . . . . . . 12-14

ROI Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16


ROI Object Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
ROI Object Function Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
ROI Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18

Overview of ROI Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19

Sharpen Region of Interest in an Image . . . . . . . . . . . . . . . . . . . . . . . . . 12-20

Apply Custom Filter to Region of Interest in Image . . . . . . . . . . . . . . . . 12-23

Fill Region of Interest in an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-26

Calculate Properties of Image Regions Using Image Region Analyzer


........................................................ 12-28

Filter Images on Properties Using Image Region Analyzer App . . . . . . 12-33

Create Image Comparison Tool Using ROIs . . . . . . . . . . . . . . . . . . . . . . 12-37

Use Freehand ROIs to Refine Segmentation Masks . . . . . . . . . . . . . . . . 12-44

Rotate Rectangle ROI to interact with imrotate . . . . . . . . . . . . . . . . . . . 12-49

Subsample or Simplify a Freehand ROI . . . . . . . . . . . . . . . . . . . . . . . . . . 12-54

xvi Contents
Measure Distances in an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-64

Use Polyline to Create An Angle Measurement Tool . . . . . . . . . . . . . . . 12-71

Create Freehand ROI Editing Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-74

Use Wait Function After Drawing ROI . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-80

Interactive Image Inpainting Using Exemplar Matching . . . . . . . . . . . . 12-83

Image Segmentation
13
Texture Segmentation Using Gabor Filters . . . . . . . . . . . . . . . . . . . . . . . . 13-2

Texture Segmentation Using Texture Filters . . . . . . . . . . . . . . . . . . . . . . . 13-7

Color-Based Segmentation Using the L*a*b* Color Space . . . . . . . . . . . 13-15

Color-Based Segmentation Using K-Means Clustering . . . . . . . . . . . . . 13-21

Marker-Controlled Watershed Segmentation . . . . . . . . . . . . . . . . . . . . . 13-26

Segment Image and Create Mask Using Color Thresholder App . . . . . 13-42

Acquire Live Images in the Color Thresholder App . . . . . . . . . . . . . . . . 13-55

Image Segmentation Using Point Clouds in the Color Thresholder App


........................................................ 13-61

Getting Started with Image Segmenter App . . . . . . . . . . . . . . . . . . . . . . 13-68


Open Image Segmenter App and Load Data . . . . . . . . . . . . . . . . . . . . . 13-68
Create and Add Regions to Segmented Mask . . . . . . . . . . . . . . . . . . . . 13-68
Refine Segmented Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-69
Export Segmentation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-70

Segment Image Using Thresholding in Image Segmenter . . . . . . . . . . 13-71

Segment Image By Drawing Regions Using Image Segmenter . . . . . . . 13-75

Segment Image Using Active Contours in Image Segmenter . . . . . . . . 13-81

Refine Segmentation Using Morphology in Image Segmenter . . . . . . . 13-87

Segment Image Using Graph Cut in Image Segmenter . . . . . . . . . . . . . 13-92

Segment Image Using Local Graph Cut (Grabcut) in Image Segmenter


....................................................... 13-101

Segment Image Using Find Circles in Image Segmenter . . . . . . . . . . 13-110

xvii
Segment Image Using Auto Cluster in Image Segmenter . . . . . . . . . . 13-117

Plot Land Classification with Color Features and Superpixels . . . . . . 13-123

Segment Lungs from 3-D Chest Scan . . . . . . . . . . . . . . . . . . . . . . . . . . 13-126

Image Deblurring
14
Image Deblurring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2
Deblurring Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3

Deblur Images Using a Wiener Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-5

Deblur Images Using a Regularized Filter . . . . . . . . . . . . . . . . . . . . . . . 14-12

Adapt the Lucy-Richardson Deconvolution for Various Image Distortions


........................................................ 14-22
Reduce the Effect of Noise Amplification . . . . . . . . . . . . . . . . . . . . . . . 14-22
Account for Nonuniform Image Quality . . . . . . . . . . . . . . . . . . . . . . . . . 14-22
Handle Camera Read-Out Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-23
Handling Undersampled Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-23
Refine the Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-23

Deblurring Images Using the Lucy-Richardson Algorithm . . . . . . . . . . 14-25

Adapt Blind Deconvolution for Various Image Distortions . . . . . . . . . . 14-37


Deblur images using blind deconvolution . . . . . . . . . . . . . . . . . . . . . . . 14-37
Refining the Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-45

Deblurring Images Using the Blind Deconvolution Algorithm . . . . . . . 14-46

Create Your Own Deblurring Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 14-54

Avoid Ringing in Deblurred Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-55

Color
15
Display Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2

Reduce the Number of Colors in an Image . . . . . . . . . . . . . . . . . . . . . . . . 15-3


Reduce Colors of Truecolor Image Using Color Approximation . . . . . . . . 15-3
Reduce Colors of Indexed Image Using imapprox . . . . . . . . . . . . . . . . . . 15-7
Reduce Colors Using Dithering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7

Profile-Based Color Space Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . 15-10


Read ICC Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-10

xviii Contents
Write ICC Profile Information to a File . . . . . . . . . . . . . . . . . . . . . . . . . 15-10
Convert RGB to CMYK Using ICC Profiles . . . . . . . . . . . . . . . . . . . . . . . 15-11
What is Rendering Intent in Profile-Based Conversions? . . . . . . . . . . . . 15-12

Device-Independent Color Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-13


Convert Between Device-Independent Color Spaces . . . . . . . . . . . . . . . 15-13
Color Space Data Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-13

Understanding Color Spaces and Color Space Conversion . . . . . . . . . . 15-15


RGB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-15
HSV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-16
CIE 1976 XYZ and CIE 1976 L*a*b* . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-17
YCbCr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-18
YIQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-19

Convert Between RGB and HSV Color Spaces . . . . . . . . . . . . . . . . . . . . 15-20

Determine If L*a*b* Value Is in RGB Gamut . . . . . . . . . . . . . . . . . . . . . . 15-24

Comparison of Auto White Balance Algorithms . . . . . . . . . . . . . . . . . . . 15-25

Big Image Processing


16
Set Spatial Referencing for Big Images . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2

Process Big Images Efficiently Using Partial Images or Lower Resolutions


......................................................... 16-8

Process Big Images Efficiently Using Mask . . . . . . . . . . . . . . . . . . . . . . 16-17

Explore Big Image Details with Interactive ROIs . . . . . . . . . . . . . . . . . . 16-28

Warp Big Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-35

Create Labeled bigimage from ROIs and Masks . . . . . . . . . . . . . . . . . . . 16-40

Neighborhood and Block Operations


17
Neighborhood or Block Processing: An Overview . . . . . . . . . . . . . . . . . . . 17-2

Sliding Neighborhood Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3


Determine the Center Pixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3
General Algorithm of Sliding Neighborhood Operations . . . . . . . . . . . . . 17-4
Border Padding Behavior in Sliding Neighborhood Operations . . . . . . . . 17-4
Implementing Linear and Nonlinear Filtering as Sliding Neighborhood
Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-4

xix
Distinct Block Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-6
Implement Block Processing Using the blockproc Function . . . . . . . . . . . 17-6
Apply Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-7

Block Size and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-9


TIFF Image Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-9
Choose Block Size to Optimize blockproc Performance . . . . . . . . . . . . . . 17-9

Parallel Block Processing on Large Image Files . . . . . . . . . . . . . . . . . . . 17-12


What is Parallel Block Processing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-12
When to Use Parallel Block Processing . . . . . . . . . . . . . . . . . . . . . . . . . 17-12
How to Use Parallel Block Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 17-12

Perform Block Processing on Image Files in Unsupported Formats . . . 17-14


Learning More About the LAN File Format . . . . . . . . . . . . . . . . . . . . . . 17-14
Parsing the Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-14
Reading the File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-15
Examining the LanAdapter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-16
Using the LanAdapter Class with blockproc . . . . . . . . . . . . . . . . . . . . . 17-19

Use Column-wise Processing to Speed Up Sliding Neighborhood or


Distinct Block Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-20
Using Column Processing with Sliding Neighborhood Operations . . . . . 17-20
Using Column Processing with Distinct Block Operations . . . . . . . . . . . 17-21

Block Processing Large Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-23

Compute Statistics for Large Images . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-28

Deep Learning
18
Train and Apply Denoising Neural Networks . . . . . . . . . . . . . . . . . . . . . . 18-2
Remove Gaussian Noise Using Pretrained Network . . . . . . . . . . . . . . . . 18-2
Train a Denoising Network Using Built-In Layers . . . . . . . . . . . . . . . . . . 18-2
Train Fully Customized Denoising Neural Network . . . . . . . . . . . . . . . . . 18-3

Remove Noise from Color Image Using Pretrained Neural Network . . . 18-5

Single Image Super-Resolution Using Deep Learning . . . . . . . . . . . . . . 18-11

JPEG Image Deblocking Using Deep Learning . . . . . . . . . . . . . . . . . . . . 18-25

Image Processing Operator Approximation Using Deep Learning . . . . 18-38

Semantic Segmentation of Multispectral Images Using Deep Learning


........................................................ 18-53

3-D Brain Tumor Segmentation Using Deep Learning . . . . . . . . . . . . . . 18-70

Deep Learning Classification of Large Multiresolution Images . . . . . . 18-82

xx Contents
Neural Style Transfer Using Deep Learning . . . . . . . . . . . . . . . . . . . . . 18-103

Code Generation for Image Processing Toolbox Functions


19
Code Generation for Image Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-2
Code Generation Using a Shared Library . . . . . . . . . . . . . . . . . . . . . . . . 19-2

List of Supported Functions with Usage Notes . . . . . . . . . . . . . . . . . . . . . 19-4

Code Generation with Cell Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-8


Setup Your Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-8
Generate Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-8

GPU Computing with Image Processing Toolbox Functions


20
Image Processing on a GPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-2

List of Supported Functions with Limitations and Other Notes . . . . . . . 20-3

Perform Thresholding and Morphological Operations on a GPU . . . . . . 20-6

Perform Element-Wise Operations on a GPU . . . . . . . . . . . . . . . . . . . . . 20-10

xxi
1

Getting Started

This topic presents two examples to get you started doing image processing using MATLAB® and the
Image Processing Toolbox software. The examples contain cross-references to other sections in the
documentation that have in-depth discussions on the concepts presented in the examples.

• “Image Processing Toolbox Product Description” on page 1-2


• “Configuration Notes” on page 1-3
• “Compilability” on page 1-4
• “Basic Image Import, Processing, and Export” on page 1-5
• “Correct Nonuniform Illumination and Analyze Foreground Objects” on page 1-10
• “Getting Help” on page 1-18
• “Acknowledgments” on page 1-19
1 Getting Started

Image Processing Toolbox Product Description


Perform image processing, visualization, and analysis

Image Processing Toolbox provides a comprehensive set of reference-standard algorithms and


workflow apps for image processing, analysis, visualization, and algorithm development. You can
perform image segmentation, image enhancement, noise reduction, geometric transformations, and
image registration using deep learning and traditional image processing techniques. The toolbox
supports processing of 2D, 3D, and arbitrarily large images.

Image Processing Toolbox apps let you automate common image processing workflows. You can
interactively segment image data, compare image registration techniques, and batch-process large
datasets. Visualization functions and apps let you explore images, 3D volumes, and videos; adjust
contrast; create histograms; and manipulate regions of interest (ROIs).

You can accelerate your algorithms by running them on multicore processors and GPUs. Many
toolbox functions support C/C++ code generation for desktop prototyping and embedded vision
system deployment.

Key Features
• Image analysis, including segmentation, morphology, statistics, and measurement
• Apps for image region analysis, image batch processing, and image registration
• 3D image processing workflows, including visualization and segmentation
• Image enhancement, filtering, geometric transformations, and deblurring algorithms
• Intensity-based and non-rigid image registration methods
• Support for CUDA enabled NVIDIA GPUs (with Parallel Computing Toolbox™)
• C-code generation support for desktop prototyping and embedded vision system deployment

1-2
Configuration Notes

Configuration Notes
To determine if the Image Processing Toolbox software is installed on your system, type this
command at the MATLAB prompt.

ver

When you enter this command, MATLAB displays information about the version of MATLAB you are
running, including a list of all toolboxes installed on your system and their version numbers. For a list
of the new features in this version of the toolbox, see the Release Notes documentation.

Many of the toolbox functions are MATLAB files with a series of MATLAB statements that implement
specialized image processing algorithms. You can view the MATLAB code for these functions using
the statement

type function_name

You can extend the capabilities of the toolbox by writing your own files, or by using the toolbox in
combination with other toolboxes, such as the Signal Processing Toolbox™ software and the Wavelet
Toolbox™ software.

For information about installing the toolbox, see the installation guide.

For the most up-to-date information about system requirements, see the system requirements page,
available in the products area at the MathWorks Web site (www.mathworks.com).

1-3
1 Getting Started

Compilability
The Image Processing Toolbox software is compilable with the MATLAB Compiler™ except for the
following functions that launch GUIs:

• cpselect
• implay
• imtool

1-4
Basic Image Import, Processing, and Export

Basic Image Import, Processing, and Export


This example shows how to read an image into the workspace, adjust the contrast in the image, and
then write the adjusted image to a file.

Step 1: Read and Display an Image

Read an image into the workspace, using the imread command. The example reads one of the
sample images included with the toolbox, an image of a young girl in a file named pout.tif , and
stores it in an array named I . imread infers from the file that the graphics file format is Tagged
Image File Format (TIFF).

I = imread('pout.tif');

Display the image, using the imshow function. You can also view an image in the Image Viewer app.
The imtool function opens the Image Viewer app which presents an integrated environment for
displaying images and performing some common image processing tasks. The Image Viewer app
provides all the image display capabilities of imshow but also provides access to several other tools
for navigating and exploring images, such as scroll bars, the Pixel Region tool, Image Information
tool, and the Contrast Adjustment tool.

imshow(I)

Step 2: Check How the Image Appears in the Workspace

Check how the imread function stores the image data in the workspace, using the whos command.
You can also check the variable in the Workspace Browser. The imread function returns the image
data in the variable I , which is a 291-by-240 element array of uint8 data.

1-5
1 Getting Started

whos I

Name Size Bytes Class Attributes

I 291x240 69840 uint8

Step 3: Improve Image Contrast

View the distribution of image pixel intensities. The image pout.tif is a somewhat low contrast
image. To see the distribution of intensities in the image, create a histogram by calling the imhist
function. (Precede the call to imhist with the figure command so that the histogram does not
overwrite the display of the image I in the current figure window.) Notice how the histogram
indicates that the intensity range of the image is rather narrow. The range does not cover the
potential range of [0, 255], and is missing the high and low values that would result in good contrast.

figure
imhist(I)

Improve the contrast in an image, using the histeq function. Histogram equalization spreads the
intensity values over the full range of the image. Display the image. (The toolbox includes several
other functions that perform contrast adjustment, including imadjust and adapthisteq, and
interactive tools such as the Adjust Contrast tool, available in the Image Viewer.)

I2 = histeq(I);
figure
imshow(I2)

1-6
Basic Image Import, Processing, and Export

Call the imhist function again to create a histogram of the equalized image I2 . If you compare the
two histograms, you can see that the histogram of I2 is more spread out over the entire range than
the histogram of I .

figure
imhist(I2)

1-7
Another Random Document on
Scribd Without Any Related Topics
THE BLACK-WINGED PRATINCOLE
Glareola melanoptera (Nordmann)

This is the Eastern form of the above, nesting from the shores of the
Black Sea eastwards to the Altai. Two specimens, which came over in
company with the commoner species, were shot in Kent in June
1903.

It may be recognised by the under wing coverts being black and the
absence of the white tips to the secondaries.
THE CREAM-COLOURED COURSER
Cursorius gallicus (J. F. Gmelin)

Inhabiting dry and arid regions south of the Mediterranean, this


species has nevertheless wandered up to our islands on several
occasions, and curiously enough always on the autumn migration,
between October and December. The general colour above and below
is sandy buff; quills and under wing coverts blackish. There is a dark
stripe behind the eye, and the nape is bluish black, this colour
extending forward to the eye. Length 10 in.; wing 6·3 in.
THE DOTTEREL
Eudromias morinellus (Linnæus)

A lonely, bleak and bare wind-swept moorland, where the scanty


herbage is kept short by the elements and the wandering 297
flocks of mountain sheep; and where the sounds of nature are
supplied on most days by the wind as it rushes down the valleys
between the rounded hill-tops, to the accompaniment perhaps of the
Curlew’s wild whistle, or where on the few calm days in summer a
deathly silence prevails, broken only by the humming of a bee as it
visits the purple heather, or the clear “go back, go back” of the male
Grouse. In such a spot one may hear a low monotonous whistle, or
have one’s attention attracted by a small flock of rapidly flying birds
skirting the crest of the hill; these are Dotterel, and this is their
summer home. This bird is extremely, one might almost say foolishly,
tame, though often owing to this tameness it will escape observation,
for, instead of taking wing as we approach, it will either stand
motionless, or running to the far side of some patch of heather
remain unseen, as its colours harmonise so well with the surrounding
heather.

The nest is a mere scrape in a bare spot, and hardly any materials
are brought together, though a few bits of moss and lichen may be
arranged round the eggs. These are three in number and are
greenish in colour, very boldly blotched and marked with brown. Both
sexes perform the duties of incubation and attend to the wants of the
young when hatched.

In this country this species is only a migrant, and in September


leaves the hill-tops, and passing through the lower lying counties of
England wings its way to other climes.
The sexes are alike and are sandy brown on the back, with
longitudinal fulvous markings; there is a white stripe over the 298
eye. Chin white; breast ash brown, bordered with a narrow
white transverse band; lower breast chestnut; belly black. In winter
the under parts are pale ash brown. The young have rufous edgings
to the feathers of the back, but otherwise resemble their parents in
winter dress. Length 9 in.; wing 6 in.
THE CASPIAN PLOVER
Ægialitis asiatica (Pallas)

Two examples of this eastern Plover, which inhabits the Caspian and
Aral Sea region, were obtained near Yarmouth in May 1890.

It is not unlike our Common Ringed Plover, but lacks all the black
markings on the head, and the band across the breast is bright
chestnut, edged along its posterior margin with black. Length 7·5 in.;
wing 5·6 in.
RINGED PLOVER
Ægialitis hiaticola (Linnæus)

Few people can have walked along our shores without having their
attention attracted by the plaintive whistle of this delightful little bird.
It will suddenly be seen flying past, the dark ring showing up in
contrast to its white breast, while as it gets farther away a light line
across the outspread wing will also help to distinguish it. 299
When it settles, especially if among stones and shingle, we
shall have hard work to see it, while the oft-repeated note, sounding
first on one side and then on the other, and coming apparently from
the dark stones themselves, tends to bewilder us. There is no month
in the year when we cannot find this bird on our shores whatever be
the weather—amidst a howling winter’s gale and driving sleet, or
under the blazing summer’s sun, when we can see the heated air
vibrating over the burning stones, he is still there, apparently
absolutely unmoved by the all-powerful forces of nature. But the time
to see him at his best is in May; we are walking along when suddenly
his well-known note strikes our ears, and we see him running along
in front of us; we sit down to watch him and he in his turn will
suddenly stop, and then running to some stone slightly higher than
its neighbours, stand up and watch us. His mate soon joins him and
together they stand, now running a few yards and then turning round
give us another look, while they bob their heads up and down at the
same time with a motion so characteristic of the Plovers. Finally,
seeing that we do not go away they both get up and, calling out as
they do so, fly off; but in a minute or so one of them is back again,
sitting and watching us from his old stand. They have evidently a
nest somewhere near, and equally, evidently, the hen has evaded our
vigilance and is closely sitting on her treasures. Disappointed we rise
to go, and on our doing so the hen rises apparently from the ground
within six feet of us and runs away.

One step, and there on the bare stones are four pear-shaped eggs
lying close packed, with their narrow ends to the centre, and 300
practically indistinguishable from the shingle on which they lie.
In colour they are pale clay, uniformly covered with black spots and
mottlings. As soon as the birds see that their treasure is discovered
they fly round us, calling out continually till we pass on, leaving the
hen to resume her duties. The young are covered with thick down
when hatched, and are brown, mottled with black on the back; below
white, with a black ring round the chest. They leave the nest as soon
as they are hatched, and very shortly begin to feed themselves on
the various spiders, flies, and other small insects that abound in such
places. Both parents carefully watch and tend them, flying up on the
approach of danger, while the young squat closely on the ground,
where they become almost invisible. Their wings grow when at the
age of five weeks, by which time they are nearly as large as their
parents, and are then well able to take care of themselves and
wander away to join the flocks of their own kind, or to amalgamate
with other passing wanderers, and add their cries to swell the sounds
of the shore, which are such a delight to every naturalist.

The sexes are alike in plumage. General colour above pale sandy
brown; below white. Forehead white, succeeded by a black band;
lores and band across chest black. Legs bright yellow; beak black,
yellow at its base.

The young resemble the adults, but lack the black band on the
forehead; the chest band is brown concolorous with the upper parts.
The legs olive green.

Generally distributed along the shore and in some inland sandy


places throughout the British Isles.
RINGED PLOVER
Ægialitis hiaticola
Male (right). Young (left)

301
THE LITTLE RINGED PLOVER
Ægialitis curonica (J. F. Gmelin)

This species breeds in Scandinavia and throughout Europe, being


rather scarcer in the west. To our shores it is only a very occasional
straggler, not more than half-a-dozen authenticated instances being
known.

It resembles the preceding species, but is rather smaller in size, paler


in colour, and the bill is narrower, longer in proportion, and wholly
black. The best characteristic, however, is that the shafts of all the
primaries, except the outer ones, are dusky, whereas in the Ringed
Plover they are all flecked with white to form a conspicuous bar when
the wing is opened. Length 6·5 in.; wing 4·5 in.
THE KENTISH PLOVER
Ægialitis cantiana (Latham)

As the Ringed Plover is one of our commonest shore birds, so the


present species is one of our rarest, and it will never be met with
unless a special journey is made to that lonely stretch of shore, which
is its only home in these islands. In habits it is almost the counterpart
of the Ringed Plover, but is a true migrant, arriving in April and
leaving in September. The note is a short monosyllabic whistle and
quite distinct from that of the preceding species.

It is a smaller bird than the Ringed Plover, which it otherwise 302


resembles, except that the dark band across the chest is
broken in the centre. Female and young resemble the male, but the
band on forehead and chest is brown instead of black, and of the
same colour as the upper parts. Length 6·25 in.; wing 4·25 in.
THE KILLDEER PLOVER
Ægialitis vocifera (Linnæus)

Only two examples of this American species have been shot in


England. It is a larger bird than any of our other Ringed Plovers,
which it somewhat resembles, but it may be recognised by its rufous
rump and upper tail coverts, a black subterminal bar and white tip to
all the tail feathers except the central pair, and the presence of two
narrow black bands across the breast. Length 9·5 in.; wing 6·5 in.
GOLDEN PLOVER
Charadrius pluvialis, Linnæus

The home of the Golden Plover is on the lower slopes of those hills
the tops of which the Dotterel takes as his own, for the Golden Plover
prefers the cover afforded by the tall heather and the more abundant
and varied insect diet of the lower lands.

As we walk up the hill we first hear his shrill whistle, and soon 303
see him coming to meet us. Settling some yards ahead, he
pipes his whistle incessantly, and then as we approach he flies on to
some other upstanding boulder, and so on for perhaps half-a-mile,
till, having escorted us to the limits of the ground over which he
claims suzerain rights, he hands us over to the ruling chief of the
next territory; Thus in a walk over the hillside we find ourselves
incessantly accompanied by one of these birds, whose cry is never
out of our ears. We have, however, only noticed half the game, for
the birds that have been accompanying us are almost always male
birds: his duty it is to stand on some exposed mound while his hen
crouches amid the heather on her precious eggs, four pear-shaped
beauties, the black spots and markings showing up against their
greenish ground colour. On the first appearance of any intruder he
will sound his pipe and fly off towards us, while his mate quietly
leaves her eggs, and, flying low, circles round till we see her
apparently coming up from a direction diametrically opposed to that
in which her treasures lie. It will be unavailing for us to lie in wait
hoping to watch her return to the nest, unless we are completely
concealed, for he will keep a close eye upon us, and until his warning
whistle is quiet she will not return. When the young are hatched both
birds meet and follow us, while in response to the warning, the
young squat close to the ground, under some sheltering piece of
heather, and so defy detection. In autumn these birds collect in large
flocks, and though many remain on the moors all the year round, the
majority come to the marshes near the sea and gradually pass
southwards.

The sexes are alike in plumage. The whole of the upper parts 304
are dark brown, with two or more yellow spots on the margins
of each feather. The throat and breast are black, bordered by a clear-
cut white line. Bill and legs black. In winter the black on the throat
and chest is replaced by white, with pale brownish mottlings across
the latter. Length 11 in.; wing 7·5 in.

The young resemble their parents in winter but the yellow is brighter,
and there are traces of yellow across the breast. It is generally
distributed throughout these islands, breeding commonly on the
moorlands, and becoming much more numerous in Scotland.
THE LESSER GOLDEN PLOVER
Charadrius dominicus, P. L. S. Müller

This species is subdivided into two forms, one of which is found in


Eastern Asia, while the other is an inhabitant of North America.

Examples of both these forms have been shot in the United Kingdom,
although the American form, as might be expected, has occurred the
more frequently of the two.

Both these forms may be distinguished from our common species,


which they closely resemble, in having the axillaries smoke grey
instead of white. Length about 9 in.; wing 6·75 in.
GOLDEN PLOVER
Charadrius pluvialis
(left)
GREY PLOVER
Squatarola helvetica
(right)

305
GREY PLOVER
Squatarola helvetica (Linnæus)

Very similar to the Golden Plover in general appearance, but the


yellow spots are replaced by whitish, and the hind toe is lacking. A
few weeks in spring and autumn along the shore is all the time this
bird spends with us; he passes the winter in the warm tropics of
Africa, wandering southwards as far as the Cape, and then, obeying
some mysterious impulse of which we can form no conception, he
journeys in May northwards, and passing over many spots, which
would to our ignorant eyes afford him food and shelter sufficient for
the rearing of his young, he seeks out the wild and lonely tundras of
Europe and Siberia.

There during the eternal day of an Arctic summer he rears his family,
and as soon as they can fly, old and young are back again on our
shores. For some weeks they remain, slowly passing to the south,
and, unlike the Golden Plover, rarely coming inland; but by the middle
of October they are all back enjoying once more the burning sun of
the tropics.

The white tail coverts and absence of the hind toe will prevent any
confusion between this species and the Golden Plover. Length 11·5
in.; wing 7·75 in.

306
THE SOCIABLE PLOVER
Vanellus gregarius (Pallas)

This species is a native of South Russia and the Aralo-Caspian area.


Until a few months ago, when a second example was procured in
Kent, it had only once (in 1860) been taken in England.

The general colour above is drab; crown of the head black, margined
with white. Quills black; secondaries white; tail white, with a
subterminal brown band. Chin white; throat buff; breast brown; belly
black; flanks and under tail coverts deep chestnut. Length 12 in.;
wing 8 in.
THE LAPWING
Vanellus vulgaris, Bechstein

No wild bird has perhaps to pay so large a tribute in eggs and


individuals to man, and yet remains as common and abundant, as the
Lapwing.

Early in March he appears on the marsh or water-meadows, where


he or his parents before him have been accustomed to spend the
summer; sometimes dry fields at some distance from the water are
chosen, but as a rule it is never far from a river, stream, or even a
moderate-sized pond. Although many pairs often nest in the same
field, fierce battles take place between the males for the mates of
their choice, but there is more “show” than strife, lengthy 307
aerial chases with much calling out but very little serious
fighting. Once, however, these early difficulties have been overcome,
the colony settles down in peace, a few ousted pairs being left to
seek some fresh ground.

The nest is merely a shallow platform of roots and bents, placed on a


small hollowed-out “scrape” on the ground. Over the actual choice of
a site there seems to be some difficulty, as many “scrapes” are
generally to be found within a few yards of the spot eventually
chosen. Towards the latter end of March the four pear-shaped eggs,
so well known in poulterers’ shops, are laid, and the hen commences
her incubation duties, which last about nineteen days. During this
period her mate wanders about in the vicinity of the nest, keeping an
ever-watchful eye for any intruder. As soon as we are seen
approaching he is up in the air, flying round with a great noise and
performing at the same time a curious tumble, but recovering himself
before touching the ground; after two or three minutes of these
antics however, he goes away, having apparently no further interest
in us or the place. We may then walk about the field in vain so far as
that pair is concerned, for they will not return to settle while we are
there and the eggs are so protectively coloured that the chances of
our seeing them, even if we walk right by them, are exceedingly
remote. While we were watching the male bird perform his curious
antics, the hen, warned by his cries, quietly slipped off the nest, and
flying low skimmed the next hedge and so away, and he, having
watched her safely into a neighbouring field, goes off to join her and
leaves us to find the eggs if we can. If we retire, however, 308
they will not be long gone; he will soon fly back, and having
ascertained that the danger is over and uttered no warning cry, she
will immediately follow, and settling near the nest, run to it and once
more cover her eggs. When the young are hatched, however, matters
are very different; both birds will then rise, and flying round our
heads beseech us with piteous cries to leave their young alone.

These cries serve the purpose of making the young squat and hide,
and their greyish green down with black mottlings so exactly
assimilates in colour with the ground, that they are almost impossible
to see. The young leave the nest as soon as they are hatched, and
utter a feeble cry not unlike that of the adults; at first their parents
feed them most carefully, picking up grubs, flies, spiders, or any
other insect that comes their way, while the young run up and take it
from their beaks, but in a few days they feed themselves, though still
carefully watched and fed by their parents. When they are full grown,
at about six weeks old, they collect in large flocks and wander over
the country. In October and November enormous flocks come over
from the Continent and settle often for three weeks or a month in a
particular field, which is usually resorted to yearly by these birds. As
winter comes on they wander about according to the weather,
wherever they can find suitable food, but with the first warm days of
February the return north begins, and March finds them back once
more in their summer home.
LAPWING
Vanellus vulgaris
Adult, summer (right). Young (left)

The upper parts are of a beautiful metallic green, the crown of 309
the head and crest being almost black. Quills black, tipped
with grey on the three outer pairs; tail feathers white, with a broad
subterminal band of black on all save the outer pair; breast black;
under tail coverts chestnut; rest of under parts white. In summer the
chin and throat are black. In the female the crest is rather shorter
and the outline of the extended wing is straighter. Length 12·5 in.;
wing 8·75 in.

The young bird has buff margins to the feathers of the upper parts.
THE TURNSTONE
Strepsilas interpres (Linnæus)

Breeding in the Far North as well as on some islands in the Baltic, the
Turnstone is only a migrant to our shores, spending some weeks with
us in autumn and returning again on a flying visit on its way to its
breeding-quarters. A small minority spend the whole winter with us,
and occasionally birds in full nuptial dress have remained in one
locality all through the summer, but its nest has never yet been found
in these islands.

Although it may be met with along almost any part of the coast, it is
most partial to rocky places and spots where shingle banks are found
amongst patches of mud. Its food consists of insects and crustacea of
all kinds, and its name is derived from the habit of turning over
stones for the sake of the insects that are thus exposed.

The nest is generally placed on the sea-shore close to high-water


mark, little rocky islets just off the shore being very favourite 310
localities. The eggs are four in number and very characteristic
of this species, being greenish grey in ground colour, spirally streaked
with brown. It is a late breeder, rarely having eggs before the
beginning of June.

After the nesting season it at once moves southwards, young being


met with on our shores by the middle of August. At this time of year
it collects in small parties of from twenty to forty, and where not
disturbed they are fairly tame and allow their curious method of
feeding to be easily observed.
This bird is very variable in plumage when adult: the head and neck
are variegated with black and white; mantle variegated with chestnut
and black. Rump and under parts white. Tail brown; breast and
shoulders chiefly black. The female resembles the male, but is slightly
larger. Most of the chestnut colouring is lost in winter. The young
have the upper parts brown, the feathers edged with white. Under
parts white. Collar and a patch on each side of the breast dark
brown. Length 9 in.; wing 6 in.
THE OYSTER-CATCHER
Hæmatopus ostralegus, Linnæus

No one who has been along the shore in winter can have failed to
notice the large flocks of black-and-white birds—Sea Pies as they are
often called—sitting on a sand-spit and, like Canute of old, defying
the tide. There they sit, till, when the water is just about to touch
their feathers, they all rise as though with one mind, and 311
shrieking out their shrill call as they go, pass along to the next
promontory which will afford them dry foothold for a few minutes
longer. Such is the Oyster-Catcher and such his life, restless as the
tide itself near which he lives. He is a common and abundant bird
throughout the year on all our coasts, feeding more especially on
mussels and limpets, which its powerful wedge-shaped bill enables it
to detach from the rocks. Other food such as crustacea and marine
insects are also eaten. Early in spring the large flocks begin to break
up into pairs.

As a rule the nest is on the shingle or the top of a low rock just
above high-water mark, but where the rocks are steep and
precipitous it is placed on the top of the cliff, many feet above the
sea-level. In Scotland they sometimes nest inland along the river
banks. The nest is merely a slight depression round which a few
snails’ shells or stones are laid, and it is to this habit rather than from
its food that it owes the name of Oyster-Catcher. The eggs, two or
three in number, are pale clay, freckled and spotted with black.
Incubation is carried on by the hen, while her mate stands on some
point of vantage from where, on the approach of a stranger, he gives
vent to his loud and noisy “keep, keep, keep,” which is continued until
the supposed danger is past. On the first note of alarm the hen
leaves her nest and soon joins in the chorus with her mate.
The young when first hatched are dark greyish brown, mottled and
striped with black; they are at once taken to the shore and are very
carefully watched over by their parents, who, when the tide is out,
take them a considerable distance below high-water mark. 312
One brood only is reared in the season, and as soon as the
young can fly they begin to gather again into flocks.

The head and neck, scapulars and mantle, lesser wing coverts and tip
of the tail are black, the rest of the plumage white. Bill orange
vermilion; legs pink. The sexes are alike, and in winter there is a
white crescent round the top and front of the neck, and the bill is
horn-coloured at the tip. The bill is continually growing and so
counteracting the wear and tear to which it is subjected. Length 16
in.; wing 9·75 in.
THE AVOCET
Recurvirostra avocetta, Linnæus

If only the amasser of British killed specimens could be exterminated


and the protection laws of this country more rigidly enforced, the
Avocet might once more become a local breeding species in some of
our counties. At present, however, a few birds arrive in our southern
and eastern counties yearly, and it is to be feared that but few live to
cross over to their breeding grounds in Holland. It used formerly to
breed in considerable numbers in the marshes of Kent and Sussex,
and along our flat eastern shores, but on the west and in the north it
has never been more than an extremely rare and local visitor. The
nest is placed on the mud or sand in an estuary, and at no great
distance from the water, and consists merely of a very small
collection of dry bents and grass. The eggs are three to four in
number and pale clay in colour, speckled with black. The note is a
clear “kluit,” generally uttered on the wing, and when disturbed these
birds are very noisy. Their food consists of small insects and
crustacea, which are captured by a sideways motion of its curiously
shaped bill. It almost always feeds in shallow water, and when
feeding walks along, slowly moving the bill from side to side on the
surface of the mud. It usually flies high, and from its coloration and
long neck is not unlike a Sheld-Duck when at a distance, but its clear
and loud “kluit, kluit,” soon betrays its identity.
OYSTER-CATCHER
Hæmatopus ostralegus
Summer

The sexes are alike; the head and back of the neck, scapulars, 313
median and tertiary wing coverts and some of the primaries
black. Rest of the plumage white. Bill black; legs pale blue. In the
young the black portions are brownish. Length 10 in.; bill 3·2 in.;
wing 8·5 in.
THE BLACK-WINGED STILT
Himantopus candidus, Bonnaterre

This species is only a very scarce straggler to our shores, generally


during the summer months. Its chief breeding grounds are along the
shores of the Danube and Black Sea, and in the marismas of
Southern Spain, whence it migrates to Africa in winter.

In the adult the mantle and wings are greenish black; tail grey; the
rest of the plumage white. Bill black, and the long legs rose pink.
Length 13·6 in.; bill 2·5 in.; wing 9·5 in.; legs 10 in.

314
GREY PHALAROPE
Phalaropus fulicarius (Linnæus)

This species only appears as an irregular autumnal visitor on our


south-eastern and southern shores, though it has been obtained both
in Scotland and Ireland. In food and habits it resembles the Red-
necked Phalarope, but its breeding range is more northerly, and is in
fact circumpolar. It is extremely tame, and allows a close approach as
it swims in shallow sheltered places a few feet from the margin of the
shore, beach pools, or inland ponds, where it happens to be.

Its visits to this country are almost always in autumn, when it is in


the grey plumage, which is grey on the back and white beneath, with
a white forehead and a black streak running backwards through the
eye. Bill black. The sexes are alike and the young similar but buffish
on the chest.

A few solitary examples are sometimes seen in nuptial dress during


the spring or very early autumn. In this plumage the head and back
are black, with rufous margins to the feathers; cheeks white; under
parts chestnut. Bill yellow. The male is rather duller in plumage than
the female. Length 8·25 in.; wing 4·9 in.
GREY PHALAROPE
Phalaropus fulicarius
(left)
RED-NECKED PHALAROPE
Phalaropus hyperboreus
(right)
Both in winter

315
THE RED-NECKED PHALAROPE
Phalaropus hyperboreus (Linnæus)

The Phalaropes are delightful little birds of very aquatic habits, and
form a splendid instance of how similar environment tends to the
production of similar structure. They may be easily recognised from
other limicoline or wading birds by their very close feathering,
especially on the breast, and their lobed feet, while in the Grey
Phalarope, especially, the bill is somewhat flattened, so that in these
birds we find a tendency towards the flattened bill as in Ducks, lobed
feet as in the Grebes, and the peculiar thick feathers on the breast
characteristic of Petrels and Gulls. The Phalaropes have also another
peculiarity unique among British birds, although shared by several
other groups in different parts of the world, namely that the duties of
incubation and rearing of the young are conducted entirely by the
male bird, and in correlation with this habit the female does all the
courting and is brighter in plumage.

One or two spots in Scotland and Ireland are the only remaining
places in our islands where this delightful bird may be found nesting,
and as an autumn and winter visitor it is decidedly rarer than the
preceding species, and very seldom found inland during the winter
months. When visiting us it will usually be seen swimming in some
sheltered tidal pool or in one of the ditches of the marsh, close to the
sea-wall. Its food consists of small insects and crustacea. At 316
its breeding haunts it is extremely tame, running about within
a few feet of the intruder.

Its summer home is usually on some inland bog, and the nest is
placed on a small tussock in a very wet place, often entirely
surrounded by water. The eggs are four in number, very pyriform in
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like