Free Sample
+ Collection

Visual Media Processing Using MATLAB Beginner's Guide

Beginner's Guide
George Siogkas

Using the versatility and power of MATLAB to apply sophisticated effects to images and videos is easy for novice programmers in any language thanks to this fantastic guide. Also suitable for photographers and video-editors.
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849697200
Paperback334 pages

About This Book

  • Apply sophisticated techniques to images and videos in just a few steps
  • Learn and practice techniques for enhancing and restoring your photographs
  • Create artistic photographs using simple methods

Who This Book Is For

This is great for novice programmers in any language who would like to use Matlab as a tool for their image and video processing needs, and also comes in handy for photographers or video editors with even less programming experience wanting to find an all-in-one tool for their tasks.

Table of Contents

Chapter 1: Basic Image Manipulations
Getting acquainted with the MATLAB environment
The ribbon
The editor
Importing and displaying an image
Time for action – importing and displaying an image
Time for action – using imtool to extract useful information
Applying geometric transformations
Time for action – rotating an image and displaying the result
Time for action – mirroring an image and displaying the result
Time for action – cropping and resizing an image, then saving it as BMP
Summary
Chapter 2: Working with Pixels In Grayscale Images
Accessing image pixels and changing their values
Time for action – whiten an area and blacken another
Thresholding an image
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
Restoring old photographs
Time for action – restoring your ancestors' photographs
Summary
Chapter 3: Morphological Operations and Object Analysis
The importance of binary images
Time for action – understanding the value of thresholding
Enlarging and shrinking a region of interest
Time for action – using dilation and erosion to refine ROIs
Altering structuring elements from strel to suit our needs
Time for action – ROI refinement using strel
Manually defining a non-rectangular ROI
Time for action – making a custom object eraser function
Analyzing objects in an image
Summary
Chapter 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
Thresholding color images
Time for action – isolating the red pixels in an image
Achieving color masking
Time for action – color isolation
The importance of different color spaces
Time for action – color space transformation
CIE-L*a*b* for more efficient color masking
Time for action – color isolation using CIE-L*a*b*
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
Taking advantage of eye circularity
Time for action – automating our function for red eye reduction
Summary
Chapter 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
Alternatives to convolution
Using imfilter
Creating filters with fspecial
Different ways to blur an image
Time for action – how much blurring is enough
Time to make art using blurring
Time for action – creating the bokeh effect in an image
Removing noise using blurring
Time for action – trying to remove different types of noise
The importance of the median filter
Time for action – removing salt & pepper with medfilt2
Bringing back the details
Time for action – enhancing the edges in our images
Brighten up the lights
Time for action – brighten up the lights in our soldier picture
Summary
Chapter 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
Time for action – working with invisible spectrums
Creating composite images
Time for action – cloning the seagull
One step beyond – blending selected image regions
Time for action – directing a threatening scene
Creating High Dynamic Range images
Time for action – composing your own HDR images
Stitching images for the creation of panoramas
Time for action – basic approach to panorama stitching
Summary
Chapter 7: Adding Motion – From Static Images to Digital Videos
An introduction to digital videos
The meaning of frames
Loading videos in MATLAB
Playing back videos in MATLAB
Time for action – reading and playing back a video
Making videos from static images
Time for action – constructing and saving a video
Inspecting a video using montage
Time for action – don't wait for the ball
A tool just for your playback needs – implay
Creating time-lapse videos
Time for action – time-lapsing a regular video
Saving your time-lapse videos in a gif file
Summary
Chapter 8: Acquiring and Processing Videos
Using MATLAB for digital video recording
Time for action – capturing a video using a firewire connection
The importance of video compression
Working with uncompressed videos
Time for action – making an edge detection video
Acquiring frames for time-lapse videos
Time for action – using MATLAB as an intervalometer
Real-time processing of time-lapse videos
Time for action – creating time-lapses with isolated colors
Real-time processing of normal videos
Time for action – adjusting the contrast of the video
Time for action – adding preview in our code
Summary
Chapter 9: Spatiotemporal Video Processing
Basic video processing with MATLAB
Time for action – loading, cropping, resizing, and saving a video
Time for action – reducing the blocking effect
Deinterlacing videos in MATLAB
Deinterlacing with the Computer Vision System Toolbox
Time for action – deinterlacing a video using the vision toolbox
Deinterlacing with the custom functions
Time for action – deinterlacing with line repetition
Time for action – deinterlacing with the scan line interpolation
Inter-frame filtering for the deinterlacing tasks
Time for action – deinterlacing with field merging
Temporal deinterlacing by field averaging
Time for action – deinterlacing with field averaging
Mixing intra-frame and inter-frame deinterlacing
Time for action – vertical and temporal interpolation method
Adding a new dimension to the filters
Time for action – implementing a spatiotemporal averaging filter
Time for action – spatiotemporal averaging filter with the convn function
Summary
Chapter 10: From Beginner to Expert – Handling Motion and 3-D
Detecting and estimating motion in videos
Time for action – detecting a moving object in a still scene
Time for action – detecting motion in a complex scene
Estimating the motion
Time for action – tracking people with Horn-Schunck optical flow
Time for action – warping frames using optical flow
Compensating camera motion using feature tracking
Time for action – tracking feature points for motion compensation of a shaky video
Working with stereoscopic images
Time for action – creating a 3-D video from left and right videos
Time for action – creating a 3-D video from a regular one
Summary

What You Will Learn

  • Apply basic geometric transformations on images
  • Manipulate pixel values in grayscale and color images
  • Select regions of interest in an image both manually and automatically
  • Apply masking techniques both in grayscale and color images
  • Write image processing scripts and functions
  • Enhance the quality of your images using filtering methods
  • Work with 3-dimensional images and videos
  • Create time-lapse videos using photographs

In Detail

Whether you want to enhance your holiday photographs or make a professional banner image for your website, you need a software tool that offers you quick and easy ways to accomplish it. All-in-one tools tend to be rare, and Matlab is one of the best available.

This book is a practical guide full of step-by-step examples and exercises that will enable you to use Matlab as a powerful, complete, and versatile alternative to traditional image and video processing software.

You will start off by learning the very basics of grayscale image manipulation in Matlab to master how to analyze 3-dimensional images and videos using the same tool. The methods you learn here are explained and expanded upon so that you gradually reach a more advanced level in Matlab image and video processing.

You will be guided through the steps of opening, transforming, and saving images, later to be mixed with advanced masking techniques both in grayscale and in color. More advanced examples of artistic image processing are also provided, like creating panoramic photographs or HDR images. The second part of the book covers video processing techniques and guides you through the processes of creating time-lapse videos from still images, and acquiring, filtering, and saving videos in Matlab.

You will learn how to use many useful functions and tools that transform Matlab from a scientific software to a powerful and complete solution for your everyday image and video processing needs.

Authors

Read More