Attribution Non-Commercial (BY-NC)

41 views

Attribution Non-Commercial (BY-NC)

- Introduction to Matlab Simulink
- MATLAB Course Content
- Recktenwald - Interactive Computing With MATLAB
- A MATLAB Tutorial
- DSP1
- PDF MATLAB
- Intro Tech Matlab
- NCCT - 2012 - 2013 IEEE Projects List - MATLAB Projects
- DeltaV Opc MatlabIntegration
- matlab-coder
- Introduction to Simulink
- Grimes, Joseph Positional Analysis
- Matlab Lectures 1
- Matlab Study
- Donalek-Matlab-1
- Chapter 01
- Lecture 14 Mat Lab
- ME1-Matlab1-2009
- MATLAB Expressions
- Mat Labs i Mu Link Tutorial

You are on page 1of 8

html

Navigator

For a practical example of using matrices, we will now

look at and manipulate multidimensional data in the

form of images. Monitor screens and images are

inherently matrices with rows and colums, where each

element (pixel) can be addressed by a particular row

and column index.

Figure 2.1

Figure 2.2

1 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

types, including JPG, BMP, GIF. We make use of the

function imread(), which takes as an argument the file

name of the image. The image file should reside in the

Current Directory, and its name must be enclosed in

single quotes, e.g.

.

, where cartman is the name of the

variable that the loaded data has been ascribed to.

Figure 2.3

Click image to enlarge, or click here to open

but either enlarged or shrunken. In order to display the

image in its true size, we use issue the following

commands:

the width of the image and 193 its height.

assignments!To find out the size of the loaded image

data, we use function . Notice that

size() returns 3 values: height, width, and layers

(discussed below).

Figure 2.4

Click image to enlarge, or click here to open

extract a portion of the image and display it:

where

[170:193] is a range of rows to extract, and the 2

following colons (:) denote "all columns", and "all

layers", respectively.

Figure 2.5

Click image to enlarge, or click here to open

2 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

extraction:

. Here we extract a specific range

of rows AND columns, while still extracting all layers.

Figure 2.6

Click image to enlarge, or click here to open

increases the combination of brightness and contrast of

the image:

Figure 2.7

Click image to enlarge, or click here to open

We can expand

Multiplying the one-line

the image data expression

by a number to make

less itthan

more

1

understandable:

decreases brightness/contrast of the image.

multiply the image data by a scalar, the first and third

lines are necessary to format the data in a particular

way. While we will not go into the details of what these

data types are, we note that raw image data cannot be

manipulated by conventional operators, such as

multiplication or addition. We must convert the data

type from uint8 to double, then manipulate the data,

and finally convert it back from double to uint8.

double; Line 2 increases brightness/contrast; Line 3

converts the data back to uint8; and Line 4 displays Figure

Figure 2.8

2.9

Click image

Click image to enlarge, or

to enlarge, or click

click here

here to

to open

open

the image.

3 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

image matrix is replaced. In this example, the

replacement sub-matrix comes from the same image

matrix, only that its brightness/contrast is increased:

expression denotes the lower portion of the image. On

the right side we index into the same portion of the

image matrix and multiply the data by a scalar, which

increases the brightness.

Figure 2.10

Click image to enlarge, or click here to open

values, one of which denotes layers. These 3 layers are

in fact 3 images of their own, representing red, green,

and blue values for each pixel in the image. The

combination of the 3 generates a full color image. How

colors are mixed is shown in Figure 2.12.

colorbar is meant to explain some general concept

behind images and colors. You are NOT required to

reproduce this in you homework assignments!

Figure 2.11

Click image to enlarge, or click here to open

4 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

Figure 2.12

respective indices ( Red = 1, Green = 2, Blue = 3, also

called RGB). The image cartman needs to be reloaded

first because it has been altered in a previous step:

To view the

red intensity image and a corresponding intensity color

bar, we issue:

The first colon denotes all rows, the

second colon all columns, and the third index denotes

the color Red.

low intensity and 64 is a high intensity.

Figure 2.13

Click image to enlarge, or click here to open

5 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

but it is also incomplete, because color intensity for

full-color images ranges not from 0 to 63, but 0 to 255.

We thus modify the color scale and re-display the

image:

shows the intensity of red color in the original image

data.

Figure 2.14

Click image to enlarge, or click here to open

Figure 2.15

Click image to enlarge, or click here to open

Figure 2.16

Click image to enlarge, or click here to open

6 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

image, such as the red layer, as shown in Figure 2.17.

While it may appear that the transpose operation

rotated the image 90 degrees, it also flipped the image

at the same time. You may wish to think about how this

happened.

Figure 2.17

Click image to enlarge, or click here to open

graph. While we will discuss meshing in a later lecture,

it may be interesting to look at a 3D intensity plot of an

image even now:

In this example,

we are examining layer 3 = blue. Before meshing the

image, we convert it to data type double.

Figure 2.18

Click image to enlarge, or click here to open

rotate button.

7 of 8 3/16/2011 2:46 PM

Matlab Lecture 2 http://www.aquaphoenix.com/lecture/matlab2/page2.html

Figure 2.19

Click image to enlarge, or click here to open

8 of 8 3/16/2011 2:46 PM

- Introduction to Matlab SimulinkUploaded bySami Kasawat
- MATLAB Course ContentUploaded byugmadhu
- Recktenwald - Interactive Computing With MATLABUploaded bysuky89
- A MATLAB TutorialUploaded bycyanpak
- DSP1Uploaded byTariq Khan
- PDF MATLABUploaded byMuhammad Fauzan Azima
- Intro Tech MatlabUploaded byb98154
- NCCT - 2012 - 2013 IEEE Projects List - MATLAB ProjectsUploaded byncctprojects3231
- DeltaV Opc MatlabIntegrationUploaded byedcocu
- matlab-coderUploaded byxacdinhdi
- Introduction to SimulinkUploaded byAlemat Tesfay
- Grimes, Joseph Positional AnalysisUploaded byHéctor Medina
- Matlab Lectures 1Uploaded byiman145
- Matlab StudyUploaded byecstacy007
- Donalek-Matlab-1Uploaded bythynameisraymond
- Chapter 01Uploaded byGovind Gaurav
- Lecture 14 Mat LabUploaded byAbrar Ahmed
- ME1-Matlab1-2009Uploaded bysharif114
- MATLAB ExpressionsUploaded byAhmed Ahmed
- Mat Labs i Mu Link TutorialUploaded byRohitUikey
- Interactive Computing With MATLABUploaded byMelike Erdoğan
- Che317 Lecture 1Uploaded bynelson
- Gui PotencialUploaded bykhkhgkh
- SSC-CHSL-8-GA-PDF-original.pdfUploaded byyuvaraj
- MIT2_019S11_SK4Uploaded byRuly Irawan
- MATLAB 2012-13 Project TitlesUploaded byncctprojects3231
- 16 DependentUploaded bySerdar Bilge
- 471L Lecture 1Uploaded bySalekin Khan
- L2-basicsUploaded byRandhirKumar
- IFEM.Ch03Uploaded byChandan Chidanand

- WASv8_WCTUploaded byNguyen
- becoming5_V1.pdfUploaded byJaymark Molo
- lr_wms.pptUploaded byjisungfiz
- Tl-wa701nd User GuideUploaded byMartin Vidarte
- School Forms Checking Report - CopyUploaded byvanessaresullar
- Mazda Bt50 Wl c & We c Wiring Diagram f198!30!05l7Uploaded bystaff055
- 39911710-1841121991Uploaded byManoj Baria
- Es-55.Pc Controlled Military Robot Using ZigbeeUploaded byUr's Tilak
- OpenText VIM_ Basic Configuration for Document ..Uploaded byAmaranathreddy Yg
- Mastech MS2203 manual.pdfUploaded byTeto Schedule
- 3d modelingUploaded byRajesh Venkatraman
- Non Linear Dynamics - Cable_tutorial_rev1Uploaded byCostynha
- 40C Lab 2 EquipotMap9Uploaded byibeupupandaway
- diseño aisc.xlsUploaded byRoberto Andrés Fernández Domínguez
- Real Madrid MBA Sports Management ThesisUploaded byHatemHammour
- SCR Phase Control Speed ControlUploaded byWil Nelson
- EE3706 - Chapter 1 - Basic ConceptsUploaded byQuang Huy Doan Ngoc
- Datasheet Flatpack2 48 v 3100 HE New PDFUploaded byNdambuki Dickson
- Addendum C. MYS Retail Design SpecificationUploaded byethan8888
- Dn9913471 8 en Global PDF Online a4Uploaded byServing Slim
- BASEPLT9.xlsUploaded bypektoph
- 028_ECE_8_SEMUploaded byDheeraj Singh
- CS-2490 600 Series 600 IdentiFlex 602 With VelocitiUploaded byGUZMAN
- Urgently Required by Qatar Fertiliser CompanyUploaded byWaqar Hussain
- Mad Catz Street Fighter v Arcade FightStick TE2 PS4 PS3 Product GuideUploaded bygota69
- 013255271X_ppt_13 GE.pdfUploaded byAdrian Nugroho
- guide7Uploaded bymallickss97
- SOCOM - Combined Assault - Manual - PS2Uploaded byAnonymous utXYfMAX
- Chromeleon 6.80 SR7 - Release NotesUploaded byirajmehr
- Vesda Hli Gw ManualUploaded byvictor