in [ ]from mahotas features import surf import mahotas as mh cat_mh mh colors rgb gray(catdog_mh mh colors rgb gray(dogcat_surf surf surf(cat_mhnr_octaves= nr_scales= initial_step_size= threshold= max_points= dog_surf surf surf(dog_mhnr_octaves= nr_scales= initial_step_size= threshold= max_points= fig plt figure(figsize ( , )ax fig add_subplot( , ax imshow(surf show_surf(cat_mhcat_surf)ax fig add_subplot( , ax imshow(surf show_surf(dog_mhdog_surf)figure - localized feature extraction with surf the square boxes in the image plots in figure - depict the square image regions around the points of interest which were used for localized feature extraction you can also use the surf densefunction to extract uniform dimensional feature descriptors at dense points with regular interval spacing in pixels the following code depicts how to achieve this in [ ]cat_surf_fds surf dense(cat_mhspacing= dog_surf_fds surf dense(dog_mhspacing= cat_surf_fds shape out[ ]( we see from the preceding output that we have obtained feature descriptors of size (elementseach you can further apply other schemes on this like aggregationflatteningand so on to derive further features another sophisticated technique that you can use to extract features on these surf feature descriptors is to use the visual bag of words modelwhich we discuss in the next section