Friday, 13 June 2014

Matlab Commands

Image Representation

Intensity:


Each pixel value in the dynamic range [minP, maxP]

Can represent a grayscale image, results of a 2d function etc.

Useful commands:

imshow () ,imagesc(), colormap()

binary masks

Can represent areas of interest in image, morphological structuring elements and more

Useful commands:

bwconncomp(),labelmatrix(), bwmorph(), bwdist(), im2bw(), bwperim()

image and video I/O

• imread() – read image

• imwrite() – write image

• im2frame() – convert image to movie frame

• movie2avi() – write avi file

• aviread() – read avi file

• mmreader()/VideoReader() – read video (better)

• VideoWriter() – create video file (2011b+)

• movie() – show movie

• implay() – show video interactively

Matrix Access

Useful Commands:


• sub2ind() – convert subscript (e.g. (r,c,clr)) to index (n).

• ind2sub() – convert index (n) to subscipt (e.g. (r,c,clr)).

• meshgrid() – generate X,Y grids.

Image Manipulation

Useful Functions:


• imcrop() – Useful for interactive cropping.

• imrotate() – Rotate image.

• imfilter() – Use kernal to convolve/correlation.

• nlfilter() – Sliding neighborhood operation.

• blockproc() – Perform function on distinct blocks.

• fspecial() – Create common image filter kernels.

• imresize() – scale up/down image using defined interpolation.

• padarray() – Pad image.

• colfilt() – Column-stack filtering (faster)

• imfreehand() – Select region with mouse

No comments:

Post a Comment