the first step will be to load the image from the diskwhere it is typically stored in an image-specific format such as png or jpegthe former being lossless compression format and the latter lossy compression one that is optimized for subjective appreciation of photographs thenwe may wish to perform preprocessing on the images (for examplenormalizing them for illumination variationswe will have classification problem as driver for this we want to be able to learn support vector machine (or otherclassifier that can learn from images thereforewe will use an intermediate representation for extracting numeric features from the images before applying machine learning finallyat the end of the we will learn about using local features these are relatively new methods (sift (scale-invariant feature transform)the first element in this new familywas introduced in and achieve very good results in many tasks loading and displaying images in order to manipulate imageswe will use package called mahotas this is an open source package (mit licenseso it can be used in any projectthat was developed by one of the authors of the book you are reading fortunatelyit is based on numpy the numpy knowledge you have acquired so far can be used for image processing there are other image packages such as scikit-image (skimage)the ndimage ( -dimensional imagemodule in scipyand the python bindings for opencv all of these work natively with numpyso you can even mix and match functionalities from different packages to get your result we start by importing mahotas with the mh abbreviationwhich we will use throughout this import mahotas as mh now we can load an image file using imreadimage mh imread('imagefile png'if imagefile png contains color image of height and width wthen image will be an array of shape (hw the first dimension is the heightthe second the widthand the third is red/green/blue other systems put the width on the first dimensionbut this is the mathematical convention and is used by all numpy-based packages the type of array will typically be np uint (an unsigned integer of bitsthese are the images that your camera takes or that your monitor can fully display