![]()
Visual Media Processing Using MATLAB Beginner's Guide
Table of Contents
Visual Media Processing Using MATLAB Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action β heading
What just happened?
Pop quiz β heading
Have a go hero β heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Basic Image Manipulations
Getting acquainted with the MATLAB environment
Default subwindows of the environment
The Command Window
The Current Folder window
The Details window
The Workspace window
The ribbon
The HOME tab
The PLOTS tab
The APPS tab
The editor
The EDITOR window
Importing and displaying an image
Importing and displaying an image using the command line
Time for action β importing and displaying an image
What just happened?
Importing and displaying an image using imtool
Time for action β using imtool to extract useful information
What just happened?
Applying geometric transformations
Performing image rotation
Time for action β rotating an image and displaying the result
What just happened?
Performing image mirroring
Time for action β mirroring an image and displaying the result
What just happened?
Have a go hero β using flipdim and comparing the results
Resizing an image
Cropping an image
Saving an image
Time for action β cropping and resizing an image, then saving it as BMP
What just happened?
Have a go hero β tailoring an image to suit your needs
Pop quiz β image processing in MATLAB
Summary
2. Working with Pixels In Grayscale Images
Accessing image pixels and changing their values
Changing the pixel values of a square area using loops
Changing the pixel values of a square area using indexing
Writing and using scripts
Time for action β whiten an area and blacken another
What just happened?
Thresholding an image
Image thresholding using for loops
Image thresholding using indexing
Image thresholding using im2bw
Image thresholding using an automatic threshold
Calculating and displaying histograms with imhist
Histogram equalization for contrast enhancement
Contrasting enhancement using imadjust
Contrasting enhancement using imcontrast
Adaptive histogram equalization using adapthisteq
Custom functions for complex tasks
Time for action β using imtool to pinpoint differences
What just happened?
Have a go hero β writing a function to enhance an image area
Restoring old photographs
Time for action β restoring your ancestors' photographs
What just happened?
Pop quiz β contrasting enhancement methods
Summary
3. Morphological Operations and Object Analysis
The importance of binary images
Time for action β understanding the value of thresholding
What just happened?
Enlarging and shrinking a region of interest
Time for action β using dilation and erosion to refine ROIs
What just happened?
Choosing a structuring element
Using strel to generate structuring elements
Altering structuring elements from strel to suit our needs
Time for action β ROI refinement using strel
What just happened?
Have a go hero β write a function to for local dilation/erosion
More morphological operations
Manually defining a non-rectangular ROI
Using roipoly to make a mask
Using imfreehand to make a mask
Time for action β making a custom object eraser function
What just happened?
Analyzing objects in an image
Detecting edges in an image
Detecting corners in an image
Detecting circles in an image
Pop quiz β object analysis pros and cons
Summary
4. Working with Color Images
An introduction to color image processing
Basic color image manipulations
Setting a rectangular area to a specified color
Time for action β repainting two areas in a color image
What just happened?
Thresholding color images
Time for action β isolating the red pixels in an image
What just happened?
Achieving color masking
Time for action β color isolation
What just happened?
The importance of different color spaces
Time for action β color space transformation
What just happened?
CIE-L*a*b* for more efficient color masking
Time for action β color isolation using CIE-L*a*b*
What just happened?
Have a go hero β writing a function for region color isolation
Fixing illumination issues in RGB color images
Fixing illumination issues in CIE-L*a*b*
A practical example β red eye reduction
Time for action β writing a function for red eye reduction
What just happened?
Taking advantage of eye circularity
Time for action β automating our function for red eye reduction
What just happened?
Pop quiz β working with color
Summary
5. 2-Dimensional Image Filtering
An introduction to image filtering
Processing neighborhoods of pixels
The basics of convolution
The ugly mathematical truth
Time for action β applying averaging filters in images
What just happened?
Alternatives to convolution
Using imfilter
Creating filters with fspecial
Different ways to blur an image
Time for action β how much blurring is enough
What just happened?
Time to make art using blurring
Time for action β creating the bokeh effect in an image
What just happened?
Have a go hero β add a motion effect in your image
Removing noise using blurring
Time for action β trying to remove different types of noise
What just happened?
The importance of the median filter
Time for action β removing salt & pepper with medfilt2
What just happened?
Have a go hero β denoising real images
Bringing back the details
Time for action β enhancing the edges in our images
What just happened?
Brighten up the lights
Time for action β brighten up the lights in our soldier picture
Pop quiz β image filtering in 2-dimensions
Summary
6. Mixing Images for Science or Art
The importance of mixing or combining images
Using multispectral imaging
Loading and manipulating the multispectral images
Time for action β visible spectrum from a multiband image of Rio
What just happened?
Time for action β working with invisible spectrums
What just happened?
Creating composite images
Using imfuse to create a composite image
Using imshowpair to inspect a composite image
Time for action β cloning the seagull
What just happened?
Have a go hero β playing Warhol with your pictures
One step beyond β blending selected image regions
...