Book Image

Visual Media Processing Using MATLAB Beginner's Guide

By : George Siogkas
Book Image

Visual Media Processing Using MATLAB Beginner's Guide

By: George Siogkas

Overview of this book

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.
Table of Contents (18 chapters)
Visual Media Processing Using MATLAB Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Getting acquainted with the MATLAB environment


In order to be able to start working with MATLAB, you should install it on your system. Since the installation is a very straightforward process, we will not cover it here. The only thing you have to be certain of, is that your installation includes the Image Processing and Image Acquisition toolboxes, which are necessary for the purposes of this book. A few examples towards the end will also need the Computer Vision System Toolbox in order to work. The version of MATLAB we will be using is 2012b, the latest available version at the time of writing this book.

Note

The functions and processes covered in this book have also been tested in MATLAB 2013a during the revision process, and work without any problems.

The first thing we see when opening MATLAB 2012b is a window comprising other windows and a ribbon with various toolbars. The ribbon has grouped sets of many processes that can be helpful for a beginner, but may prove distracting when the user has acquired more experience. This is why, besides giving a few details in this chapter, we will be avoiding extensive use of the ribbon, limiting it to the most time-saving and relevant processes to digital media processing. The subwindows residing in the environment of MATLAB will be our basic tools in this book, along with the MATLAB editor, which is the basic core tool for writing your own scripts and functions.

Default subwindows of the environment

The pre-set windows you will face when first using the application will be:

  • The Command Window

  • The Workspace window

  • The Command History window

  • The Current Folder window

  • The Details window

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Note

It is worth noting that the environment of MATLAB 2012b has been altered significantly compared to previous versions, mainly because of the inclusion of a ribbon menu resembling the one used in Microsoft Office 2007 onward. However, since most of the processes described in this book are based on using the command line, users of previous versions will not have problems following the examples.

The Command Window

Most of the MATLAB usage time will probably be spent on typing commands in the command line. The command line resides in the Command Window and starts with the symbol fx which is clickable and contains a list of all installed functions organized by toolbox. Following this symbol, there is the prompt symbol, >>, followed by a blinking cursor at the place where you can enter commands. All codes that must be written in the command line will be preceded by the prompt symbol in this book.

The available commands are all the inherent MATLAB functions, most of which help you manipulate matrices (hence the name: MATrixLABoratory). In this book, we will mainly be using functions for image manipulation, included in the Image Processing and Image Acquisition toolboxes.

The Current Folder window

The Current Folder window is basically a file manager, resembling Windows Explorer. You can navigate your way through the folders in your computer, in order to find files you would like to use in your work, for example, an image you would like to load. By default, MATLAB can access the contents of the current folder and a number of folders that have been included in its path. During installation, all the folders containing the installed toolboxes have been added to MATLAB's path; hence the functions and files contained in them can be accessed no matter what the current folder is.

The Details window

The Details window is also informative, displaying information about the file you have selected in the current folder window. The details are displayed only when the selected file is recognized by MATLAB.

The Workspace window

The Workspace window is used for a constant view of all variables that are present, providing information about their names, types, plus minimum and maximum values, where this is applicable.