# Texture-like measures for quantifying density of data in binary images

Consider the following black-and-white image. It depicts a freehand sketch.

I wish to characterize the "density" of sketch strokes. For e.g. the hair strokes are densely grouped together. So are strokes near the wrists and the necklace stone. Other strokes are somewhat scattered and "far", e.g. the nearly vertical strokes depicting the dress.

Is there a good measure (texture-like ?) which can be used to quantify the above notion ?

• Great question! – Dipan Mehta Jul 23 '15 at 11:39

One of the most obvious that comes to mind is MPEG-7's Edge Histogram Descriptor.

In this, you divide the image into blocks and consider the edge pixels across different angles forming the complete local histogram. This is organized the same way as a Gabor transform features at angular orientation at different angles. This is fairly a very good indicator to classify and search pictures with similarity in their structures and hence edges.

See this reference 2 which is a great introduction to MPEG 7 color and texture. See Reference 3 for a more detailed coverage for the Local Edge descriptors.

• Reference 3 seems promising. I shall try it out and compare its performance with the measure I am already using. – curryage Jul 25 '15 at 1:39

If you are dealing purely with binary images then simply counting the number of foreground pixels versus the number of background pixels in a sliding $M \times N$ window will produce another image depicting the areas of higher "ink" density. This is probably the most simple metric you can use.

For images with colour depth greater than 2, Entropy (again, evaluated over a sliding window) would be a better metric in quantifying the complexity of an area of the image.

Finally, Haralick's features offer a larger selection of features used to quantify various aspects of texture. For more information please see this and this link.

• $M \times N$ window was what I had in mind as well, but I wished to avoid the decision of picking $M,N$. – curryage Jun 23 '15 at 2:36

I ended up using the radon transform in 8 canonical directions. I then normalized the resulting distribution and computed its entropy. The numbers seem to correlate with level of texture in the image.