Region description

Basic description

Basic properties like area, Euler number, minimum rectangle that wraps the figure, etc. a region can be defined inside an image. In MATLAB we do this process in the following way:

B = bwlabel(f);
D = regionprops(B, properties)

where f is the image that contains the regions that we want to describe. The first thing we do is to convert the image to a representation through labels, using the first command.

The second command takes that labelled matrix and calculates the properties that we want. For example:

D = regionprops(B, 'area', 'boundingbox')

This would produce a structure like the following:

D =
	Area: 19939
	BoundingBox: [30.5000 19.5000 223 306]

The properties we want to calculate are listed separated by commas, as shown in the previous example. There are several properties:

Invariant moments


ηpq= ηpqη00y

The following six moments give us six different numeric values that are insensitive to image transformations like scale changes, mirroring and rotation:







Main Components

We can describe an image using main componets. Suppose we have a group of images and we build the following group of matrices:

Snapshot of MATLAB interface

The average vector would be:


where K = MN. Then, the covariance matrix can be built, with a size of mxm, like this:


The eigenvalues and eigenvectors would then be:



We can reduce the number of eigenvalues to q. Then, the previous equation would turn into:


If we stay with the main eigenvalues (the largest ones), we can obtain a reduced group of images that have the most relevant information. At the same time, this eigenvalues characterize the properties of the images.

The following command in MATLAB makes all the necessary calculations:

P = princomp(X,q)

where X is a matrix that contains the vectors x of the previous expressions, q is the number of eigenvalues that we want to obtain, and P is a structure that contains several things:

You can practice these concepts using snippet08.