You are on page 1of 3

INSIGHT TO MATLAB IMAGE PROCESSING TOOLBOX

ABOUZAR ESLAMI AND EMADODIN FATEMIZADEH

Abstract. This note prepares initial information for starting with Matlab
DIP toolbox. the note contains an abridged list of instructions with their brief
comment quoted from Matlab.

1. Matlab DIP Toolbox


Matlab digital image processing toolbox is able to perform a large various image
processing tasks. there are two important I/O instructions (imread and imwrite)to
load and save images with various extensions. Usual data type of images is 8 bit
unsigned integer which is not conventional for matlab. major part of functions
deal with double type variables. consequently, it is recommended to convert im-
age matrix to double data type using double instruction. generally speaking, uint8
variables in image processing are held in [0−255] and double variables in [0−1]. in-
structions as imshow and applycform strictly obey such dynamic range constraints.
three types of images are defined in matlab: color, gray and indexed. for each
pixel of a color image, 3 bytes are dedicated to color components. it is possible
to transform well known color spaces with makecform and applycform. initial pro-
cesses perform on gray scale images in which each pixel has an 8 bit intensity.
mention that the image matrix size is not appropriate to investigate whether image
is gray or color. for a 3–D matrix with identical RGB color components, there is
no color. abandoned instruction of isgray (develop your own image type check) in
addition to rgb2gray can be employed for gray scale processes. an special case of
gray images is black and white images with just two intensity levels. the last image
type is indexed image in which each pixel has an index refereing to an specific color
in associated color map. color space transforms are also applicable to color maps
while color maps also obey double and uint8 dynamic ranges. except for extract-
ing color image from gray or BW images (which has its own ambiguity), there are
functions to convert other images.
many of well known signal processing functions are extended for 2–D processing
as fft2, corr2, conv2, filter2. although there are alternatives, especially designed
for image processing as imfilter, imadd and etc., but it is recommended to convert
image to double and exploit all matlab functions since the number of predefined
image functions is restricted.
pixel addressing in matlab differs from addressing in text book. indeed the axis x
and y are replaced with n2 and n1 respectively. consequently, two pixels of I(n1 , n2 )
and I(n′1 , n2 ) have same horizontal coordination while I(n1 , n2 ) and I(n1 , n′2 ) have
same vertical coordination. there are two ways for addressing the pixel in matlab
(not 3-byte color images). in conventional way I(q1 , q2 ) represents the pixel of
[q1 , q2 ]T that can also be addressed by one index as q = (q2 − 1)size(I, 1) + q1 .
occasionally, this one element addressing simplifies m-file development.
1
2 ABOUZAR ESLAMI AND EMADODIN FATEMIZADEH

in addition to intensity processes, there is a group of functions (namely spatial


transforms) usually employed for registrations and motion modelling (camera or
object). two important and general functions of this group are maketform and
imtransform that can apply many spatial transforms (affine, bilinear, ...). with
respect to high computation and time cost of these functions, it is recommended
to use substitutes as imrotate and imresize when the motion or deformation is not
sophisticated. it is even possible to develop code for half–pel (or less) accuracy
deformation using interp2.
finally, try the imtool to see images which prepares some tools for image inves-
tigation and try to get acquainted with roipoly which make yo able to extract a
desirable surface by preparing a cursor tool.
INSIGHT TO MATLAB IMAGE PROCESSING TOOLBOX 3

2. Frequent Instructions
image Create and display image object
imagesc Scale data and display as image
imshow Display image in a MATLAB figure window
imtool Display image in the Image Viewer
dicomread Read a DICOM image
dicomwrite Write a DICOM image
imfinfo Return information about image file
imread Read image file
imwrite Write image file
double Convert data to double precision
gray2ind Convert intensity image to indexed image
grayslice Create indexed image from intensity image by thresholding
graythresh Compute global image threshold using Otsu’s method
im2bw Convert image to binary image by thresholding
im2double Convert image array to double precision
im2uint8 Convert image array to 8-bit unsigned integers
ind2gray Convert indexed image to intensity image
ind2rgb Convert indexed image to RGB image
rgb2gray Convert RGB image or colormap to grayscale
rgb2ind Convert RGB image to indexed image
imcrop Crop image
imresize Resize image
imrotate Rotate image
imtransform Apply 2-D spatial transformation to image
makeresampler Create resampling structure
maketform Create geometric transformation structure
reshape Reshape array
roipoly Select polygonal region of interest
bwboundaries Trace region boundaries in binary image
bwtraceboundary Trace object in binary image
edge Find edges in intensity image
entropy Entropy of an intensity image
corr2 Compute 2-D correlation coefficient
imhist Display histogram of image data
mean2 Compute mean of matrix elements
std2 Compute standard deviation of matrix elements
histeq Enhance contrast using histogram equalization
imadjust Adjust image intensity values or colormap
imnoise Add noise to an image
medfilt2 Perform 2-D median filtering
ordfilt2 Perform 2-D order-statistic filtering
wiener2 Perform 2-D adaptive noise-removal filtering
conv2 Perform 2-D convolution
filter2 Perform 2-D filtering
fspecial Create predefined filters
imfilter Multidimensional image filtering
freqz2 Compute 2-D frequency response
fwind1 Design 2-D FIR filter using 1-D window method
fwind2 Design 2-D FIR filter using 2-D window method
dct2 Compute 2-D discrete cosine transform
fft2 Compute 2-D fast Fourier transform
fftshift Reverse quadrants of output of FFT
idct2 Compute 2-D inverse discrete cosine transform
ifft2 Compute 2-D inverse fast Fourier transform
iradon Compute inverse Radon transform
radon Compute Radon transform

You might also like