01.04.2015 Views

1FfUrl0

1FfUrl0

1FfUrl0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10<br />

We previously used an example of the buildings class. Here are examples of the text<br />

and scene classes:<br />

Pattern recognition is just classification of images<br />

For historical reasons, the classification of images has been called pattern<br />

recognition. However, this is nothing more than the application of<br />

classification methods to images. Naturally, images have their own<br />

specific issues, which is what we will be dealing with in this chapter.<br />

Computing features from images<br />

With mahotas, it is very easy to compute features from images. There is a submodule<br />

named mahotas.features where feature computation functions are available.<br />

A commonly used set of features are the Haralick texture features. As with many<br />

methods in image processing, this method was named after its inventor. These<br />

features are texture-based: they distinguish between images that are smooth and<br />

those that are patterned and have between different patterns. With mahotas, it is<br />

very easy to compute them:<br />

haralick_features = np.mean(mh.features.haralick(image),0)<br />

The function mh.features.haralick returns a 4x13 array. The first dimension<br />

refers to four possible directions in which to compute the features (up, down, left,<br />

and right). If we are not interested in the direction, we can use the mean overall<br />

directions. Based on this function, it is very easy to classify a system.<br />

[ 211 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!