Let's say we have a number of color images that are examples of some textured pattern. There is a rare occurrence where this texture is "disrupted" by some foreign object. What would be the best way to detect these rare anomalies?
I thought about training a CNN, but the number of good examples vastly outnumbers the bad examples, so I have my doubts. I started looking into grey level co-occurrence matrices (GLCM) and local binary patterns (LBP), but I think color information could play an important part in determining the occurrence of a disruption. Could I find the distribution from these extracted features (of either GLCM or LBP) and calculate the probability that a new image belongs to this distribution?
Thanks for your help!
It is difficult to figure out your problem without seeing some sample images. In principle there's a wide variety of approaches you could use to detect texture disruption, namely GLCM features, LBPs, Law's masks, vector quantization, etc. Measuring the local entropy is a possible way to go. Consider the image below, in which we can clearly distinguish two types of texture:
The following snippet reads the image, computes the local entropy for each pixel on a circular neighbourhood or a given radius 25
and displays the results:
from skimage import io
from skimage.filters.rank import entropy
from skimage.morphology import disk
img = io.imread('https://i.sstatic.net/Wv74a.png')
R = 25
filtered = entropy(img, disk(R))
io.imshow(filtered)
It clearly emerges from the resulting entropy map that the local entropy values could be utilized to detect texture disruption.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With