PacktLib: Visual Media Processing Using MATLAB Beginner's Guide

Visual Media Processing Using MATLAB Beginner's Guide

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

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

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

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

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

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

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

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

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

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

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

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Pop Quiz Answers

Index