Reputation: 737
This can be generalized to: How do I remove regions that look similar to another region from an image?
The big Image is in grayscale. I have a lot of sand in it and I need to detect features.
The Sand particles are multiple pixels big. I know where the sand in the pictures is.
It looks something like this:
I have this kind of sand (not yet in grayscale):
What I want to achieve is that all the sand becomes a single value from 0.0 to 1.0 or one with very little variation;
That way I will be able to detect the features with ease.
So basically: Take everything that looks similar to some region in the image and remove that noisy aspect from the image.
I thought maybe one could do something like:
noise + noise = noise; it looks just as noise as before.
noise + features = noise; looks more noisy than before
(that might actually be the solution, though i still wanna ask you people)
What kind of algorithms are suitable and what do you suggest?
EDIT: This is an actual Image.
Upvotes: 2
Views: 557
Reputation: 737
For those that happen to stumble upon this. In the end I settled for the Trainable WEKA Segmentation. I used Fiji (ImageJ) to try it out. It worked a lot better than all the others. The noise was always different so template matching didn't work well enough unfortunately. Another one that looked promising was the Statistical Region Merging I found in Fiji under Plugins>Segmentation. But WEKA gave the best results.
I do hope though, that I will find something faster eventually.
Upvotes: 0
Reputation: 901
I can suggest you to try template matching.
(Blurring source image with mean or Gaussian filter before further transforms may have sense, but it must not affect features to much).
Filter regions with mean value and deviation close to noise (estimate this value for sand regions). Filter size shouldn't be very big in this case, 2+ times smaller than searched features.
More sophisticated way is template matching. It's pixel-to-pixel comparison of template region (sand) with image region. If result is lower (or higher, depends on method used) than some threshold template is matched. But I think in your case it may work worse than basic filters mentioned above.
Also you can try to use Sobel's operator or some other variant of image derivatives. In order to find edges on image (your features seemed to have one while sand doesn't).
P.S. Will try to add couple of pics with described method applied to your example image little later.
Upvotes: 1