For example, let's say you want to add a new feature (or even a set of features). As we saw in Chapter 12, Computer Vision, this is easy to do by changing the feature computation code. However, this would imply recomputing all the features again, which is wasteful, particularly if you want to test new features and techniques quickly.
We now add a set of features, that is, another type of texture feature called linear binary patterns. This is implemented in mahotas; we just need to call a function, but we wrap it in TaskGenerator:
@TaskGenerator def compute_lbp(fname): from mahotas.features import lbp imc = mh.imread(fname) im = mh.colors.rgb2grey(imc) # The parameters 'radius' and 'points' are set to typical values # check the documentation for their exact meaning return lbp(im, radius=8, points=6...