fd_catcat_hog hog(cgsorientations= pixels_per_cell=( )cells_per_block=( )visualise=truefd_dogdog_hog hog(dgsorientations= pixels_per_cell=( )cells_per_block=( )visualise=truerescaling intensity to get better plots cat_hogs exposure rescale_intensity(cat_hogin_range=( )dog_hogs exposure rescale_intensity(dog_hogin_range=( )fig plt figure(figsize ( , )ax fig add_subplot( , ax imshow(cat_hogscmap='binary'ax fig add_subplot( , ax imshow(dog_hogscmap='binary'figure - hog object detector to extract features based on object detection the image plots in figure - show us how the hog detector has identified the objects in our sample images you can also get the flattened feature descriptors as follows in [ ]print(fd_catfd_cat shape ( ,localized feature extraction we have talked about aggregating pixel values from two-dimensional image or feature matrices and also flattening them into feature vectors localized feature extraction based techniques are slightly better methods which try to detect and extract localized feature descriptors on various small localized regions of our input images this is hence rightly named localized feature extraction we will be using the popular and patented surf algorithm invented by herbert bayet al surf stands for speeded up robust features the main idea is to get scale invariant local feature descriptors from images which can be used later as image features this algorithm is similar to the popular sift algorithm there are mainly two major phases in this algorithm the first phase is to detect points of interest using square shaped filters and hessian matrices the second phase is to build feature descriptors by extracting localized features around these points of interest there are usually computed by taking localized square image region around point of interest and then aggregating haar wavelet responses at specific interval based sample points we use the mahotas python framework for extracting surf feature descriptors from our sample images