1 | initial version |
Another idea would be to analyse the gradients. On the grass, the gradients should be a directional; on a rough concrete surface they are chaotic, on a smooth surface they are weak.
So compute the gradients Gx
and Gy
of the image, and in a given region compute the PCA on the gradients. Let L1
and L2
be the first two principal components
If L1/L2
is high, than the image has directional gradients, so it's probably grass. If L2
is high, then you have a rough surface; if L1
has a low value, the region is smooth.