Detecting a stain in a texture

7 views (last 30 days)
Rafael Andrade
Rafael Andrade on 5 Dec 2013
I'm trying to detect a stain in an image. The original image has a marble background and the stain its almost the same color, sometimes the stain is darker and sometimes brighter than the marble background. See some examples:
I would like to know if there is a function that can detect such stain. The difficulty is distinguish the stain from the marble texture background. Can somebody help me?

Answers (1)

Constantino Carlos Reyes-Aldasoro
This would not be that difficult,
marble = imread('');
marble2 = marble(:,:,2)<120;
just by intensity you can distinguish the central part, if you use some morphological operators you could remove small parts and consolidate the centre. The only problem is the finger ...


Find more on Biomedical Imaging in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by