howeverit is also possible that your particular use case would benefit from few specially designed features for examplewe may think that in order to distinguish text from natural imagesit is an important defining feature of text that it is "edgy we do not mean what the text says (that may be edgy or square)but rather that images of text have many edges thereforewe may want to introduce an "edginess featurethere are few ways in which to do so (infinitely manyone of the advantages of machine learning systems is that we can just write up few of these ideas and let the system figure out which ones are good and which ones are not we start with introducing another traditional image-processing operationedge finding in this casewe will use sobel filtering mathematicallywe filter (convolveour image with two matricesthe vertical one is shown in the following screenshotand the horizontal one is shown herewe then sum up the squared result for an overall measure of edginess at each point (in other usesyou may want to distinguish horizontal from vertical edges and use these in another wayas alwaysthis depends on the underlying applicationmahotas supports sobel filtering as followsfiltered mh sobel(imagejust_filter=true