You are on page 1of 10

150:

150:

150



:
Matlab Image Processing
Toolbox



2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

Matlab

Matlab

m-

Gonzales [2004]: Chapter 2

Tutorial on Matlab Digital Image Processing Toolbox,


http://www.mathworks.com/access/helpdesk/help/toolbox/ima
ges/images.shtml
http://www.ph.tn.tudelft.nl/DIPlib/dipimage_1.html

2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

Image Processing Toolbox, Matlab,


http://www.mathworks.com/products/image/
http://www.mathworks.com/products/image/tryit.html

Image processing with Java 2D,


http://www.javaworld.com/javaworld/jw-09-1998/jw-09media.html
http://www.utopia1.demon.co.uk/JavaIPL/
http://www.developer.com/java/other/article.php/3403921

Intel, Open Source Computer Vision Library (OpenCV)


http://www.intel.com/technology/computing/opencv/

2005 Nicolas Tsapatsoulis


150:
150:


Matlab
Matlab


m-

Matlab

Matlab= Matrix Laboratory


(matrices)
. 1
( )

()


(Graphical User Interface)

demo Command prompt Matlab


Matlab

2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

Matlab Desktop

:
Command Window
Current Directory
Workspace Browser
Command History
Figure Window

Path

directories
Matlab

2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

O Matlab Editor

Text editor debugger m-files

editor Command Prompt

edit

edit filename ( m-file filename )

2005 Nicolas Tsapatsoulis


150:
150:


Matlab
Matlab


m-

Matlab: Help
browser

2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

Matlab:

doc filename help browser


: doc imadjust

help filename
filename (help text block)

: help imadjust

type filename ( )
filename

: type imadjust

lookfor keyword
keyword

: lookfor histogram

2005 Nicolas Tsapatsoulis

150:
150:


Matlab
Matlab


m-

Workspace browser:

Save Workspace As.

Command prompt:

save WorkspaceName

: save session24102005

save WorkspaceName Variable1 Variable2

: save session24102005 X map


.mat

Workspace browser

: load WorkspaceName Command prompt

2005 Nicolas Tsapatsoulis


150:
150:

;
;


Matlab
Matlab


m-


Matlab

Matlab

: , ,

: RGB, HIS,YIQ .

: Matlab pixels 1
0 ( )
2005 Nicolas Tsapatsoulis

150:
150:

;
;
;


Matlab
Matlab


m-

Matlab
imread(filename)

: f=imread('PC250128.jpg');


f o PC250128.jpg

size(f)

:
[f map]=imread('Unipi-logo.gif');
2005 Nicolas Tsapatsoulis

150:
150:

;
;
;


Matlab
Matlab


m-




imshow(matrixname)

matrixname



:

imshow(f)

imshow(f, map) (
)

imshow(f, [low high]) (


)

figure

pixval
2005 Nicolas Tsapatsoulis


150:
150:

;
; Matlab
; Matlab


m-

Matlab
imwrite (matrixname, filename)

imwrite (g, pouf2.png');

imwrite (g, pouf3.jpg,quality,50);

imwrite (g, pouf3.tif,compression,packbits,resolution,[300 300]);

figures (
)

print fno dfileformat rresno filename

: print -f2 -dpng -r300 histogram.png


2005 Nicolas Tsapatsoulis

150:
150:

;
;
;


Matlab
Matlab


m-

()


quality
(
jpg tif):

imwrite (g,
pouf3.jpg,quality,50);

imwrite (g,
pouf3.jpg,quality,25);

imwrite (g,
pouf3.jpg,quality,15);

imwrite (g,
pouf3.jpg,quality,5);

imwrite (g,
pouf3.jpg,quality,0);

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;


Matlab
Matlab


m-

()

pixel

imwrite (g,
pouf3.tif,resolution,[300 300]);.

imfinfo(filename);

: imfinfo(pouf3.tif);

2005 Nicolas Tsapatsoulis


150:
150:

;
;
;
;


Matlab
Matlab


m-

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;


Matlab
Matlab


m-

( )- intensity images.

pixels [0 255] (
uint8) [0 65535] ( uint16)
[0 1] ( double)

( ) binary images

- pixels 0 1 (
logical)

(
) indexed images

pixels
( Matlab
map)

RGB images

[MxNx3]. pixels
[0 255]. pixel
(R,G,B).
2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;


Matlab
Matlab


m-

()

: RGB

g=rgb2gray (f); f RGB g .

:
(binary)
b=im2bw (g); g b .

f=ind2gray (g); g f
.

2005 Nicolas Tsapatsoulis


150:
150:

;
;
;
;
;


Matlab
Matlab


m-

.m (m-files) :

scripts


()

m :

(function definition line)

1 (H1 line)

(help text block)

(function body)

(comments)

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-

m-

(function definition line)


:

function [outputs] = functionName(inputs)

function [ProcessedImage, MaxValue] = medianDenoise(fileIn, fileOut)

m-functions Command
Window m-functions.


Command Window:
> [NewImage, MaxV] = medianDenoise(pouf3.tif, fouf3-denoisy.jpg);

1 (H1 line)
:

% MEDIANDENOISE MEDIANDENOISE performs median filtering in


% an image stored in fileIn and saves the result to fileOut
2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-

m- ()

(help text block)


1 .


H1

help functionName (.. help medianDenoise)

(function body)


.
; .

(comments)

.
.
2005 Nicolas Tsapatsoulis


150:
150:

;
;
;
;
;


Matlab
Matlab


m-

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-


uint8 uint16 ( +,-,/,*,./,.*)
.
uint8 uint16


double .
2005 Nicolas Tsapatsoulis


150:
150:

;
;
;
;
;


Matlab
Matlab


m-

(
) .
1 0.

: =[1 2;3 4] =[4 3;2 1].


:

> [0 0;1 1]

== [0 0;0 0]

~= [1 1;1 1]

1
2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-

: =[1 2;3 -4] =[0 -1;2 0].

xor(, )= [1 0;0 1]

all(A)=[1 1]

all(B)=[0 0]

any(A)=[1 1]

any(B)=[1 1]

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;


Matlab
Matlab


m-

()

2005 Nicolas Tsapatsoulis


150:
150:

;
;
;
;
;


Matlab
Matlab


m-

2005 Nicolas Tsapatsoulis

150:
150:

;
;
;
;
;
;


Matlab
Matlab


m-


Image Processing Toolbox (IPT)

IPT
demo toolbox Matlab.

Matlab demo
( Command prompt Matlab demo)

2005 Nicolas Tsapatsoulis

10

You might also like