Visual Media Processing Using Matlab Beginner's Guide
上QQ阅读APP看书,第一时间看更新

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.