Sei sulla pagina 1di 3

Out line

Im age Array Indexing


Int ensit y Coding Schem es
Dat a Form at s
Dat a Conversions
Im port ing & Export ing Im ages
Im age Display

MATLAB for Im age Processing


BE 244 Medical Im age Processing
and Analysis

Im age Array Indexing

Im age Array Indexing


Spat ial Coordinat es

Pixel Coordinat es

Im age: 1 or m ore 2D arrays I(m ,n)


Each elem ent of I(m ,n) is a pixel

0.5 1 1.5 2 2.5 3 3.5 4 4.5

0.5

Pixel coordinat es (m ,n):






Most com m on for im ages


m rows increase top t o bot t om
n colum ns increase left to right





I(1,2)

. . .

I(1,n)

I(2,1)

I(2,2)

. . .

I(2,n)

.
.
.

.
.
.

I(m ,1
)

I(m ,2
)

1
1.5

Spat ial coordinat es (x,y):




I(1,1)

2
2.5

.
.
.

3
3.5

Allows non-integer indexing


Cent er of ULC pixel is (1,1)
ULC origin is (0.5,0.5)
Opposit e pixel
x colum ns & y rows ! ! !
coordinat e index ing

. . .

I(m ,n
)

4
4.5

I(3,2)

I(2,3)

Int ensit y Coding Schem es

Binary Im ages

Binary im ages:
[ 0,1]
Int ensit y im ages: [ 0:1] or uint 8
Index im ages:
M x 3 color m ap
m at rix
RGB im ages:
Mx Nx3

Dat a Mat rix (B)

B
1





 [ 0,1]
 [ on, off]
 [ t rue,false]
 et c.

Binary Im age


All im age dat a is of t ype uint or double

Mx N
B & W im age
Only t wo values

Oft en used as m asks


for select ing regionsof-interest (ROIs) from
ot her im ages

Index Im ages
Dat a Mat rix (I)

I
250

100

50

25

50

75





100

50

250


Int ensit y Im age

Mx N
Greyscale im age
Each v alue designates
an int ensity
[ 0:1] or [ 0:255]
(uint 8)

m ap

Vect or
#

Int ensit y Im ages

Colorm ap Mat rix


(m ap)



Dat a Mat rix (X)




Index
Im age

C x 3 m at rix
3 cols: Red, Blue,
Green
C rows: Color vector
[ 0:1]
Also called a color
lookup t able (LUT)
Mx N
Each v alue point s to a
specific color v ector in
t he colorm ap
8

[ X, m ap] = im age file

RGB Im ages

Mult ifram e Im ages (IMF)


Dat a Mat rix




G


M x N x 3 RGB(m ,n,i)
Each color page (aka
bit plane) has values
[ 0:1]
An individual pix el
color is defined by t he
corresponding v alues
in the t hree color
pages

Also called volum e im ages


Each im age in t he set is a fram e
IMF = cat (4, I1, I2, I3, ) where 4
indicat es t he concat enat ion dim ension
IMF = (m , n, i, j)



i = RGB variable
j = fram e index

All im age files are


act ually 3D, w here t he
3rd variable is 1 for
grayscale im ages

RGB
Im age

Im age and Dat a Form at s


Indexed

Int ensit y

Binary

Im age Dat a Conversions


RGB

Doubl
e
Dat a

Im age: MxN int


array [ 1:P]
Colorm ap: Cx3
float array [ 0:1]

Mx N float
array
[0:1]

Mx N
logical
array [ 0 1]

Mx Nx3 float
array [ 0:1]

Uint 8
Dat a

Im age: MxN int


array [ 0:P -1];
P< 256
Colorm ap: Cx3
float array [ 0:1]
Im age: MxN int
array [ 1:P -1];
P< 65536
Colorm ap: Cx3
float array [ 0:1]

Mx N int
array
[0:255]

Mx N
logical
array [ 0 1]
nb
1= whit e
Not
support ed

Mx Nx3 int
array [ 0:255]

Uint 1
6
Dat a

Mx N int
array
[0:65535]

10

Mx Nx3 int
array
[0:65535]

Ref. Mat hWorks Training


Manual

11

ind2gray - index ed to int ensity


int 2rgb - index ed to RGB
gray2ind - intensit y t o index ed
rgb2ind - RGB t o index ed
m at2gray - m atrix to int ensit y im age
im 2bw - t hreshold im age t o create binary im age
im 2double - im age array to double array
im 2uint8 - im age array to 8-bit int array
im 2uint16 - im age array to 16-bit int

12

Im port ing & Export ing Im ages

Displaying Im ages
figure - opens new window for displaying
im age
im show - displays im age using IPT
preferences
m ov = im ovie(MFW); m ovie(m ov)

im finfo - ret urns file inform at ion


im read - reads im age


Indexed Im ages:
[ X,m ap] = im read(file.fm t )
Int ensit y, RGB, & Binary Im ages:
X= im read(file.fm t )

im writ e - writ es im age

13

Im age Processing Toolbox


Preferences
ipt get pref - Get IPT preference
ipt set pref - Set IPT preference
Set t able preferences:





Im show Border: [ { loose} , t ight ]


Im show AxesVisible:[ on , { off} ]
Im show Truesize: [ { aut o} , m anual ]
TruesizeWarning: [ { on } , off ]
default values show n in { }

15

im age - creat e and display im age object


im agesc - scale dat a and display as an im age
m ont age - displays m ult ifram e im age as a
m ont age
colorbar - display colorbar of t he indexed im age
colorm ap - set s colorm ap
14

Potrebbero piacerti anche