Detecting a stain in a texture

4 ビュー (過去 30 日間)
Rafael Andrade
Rafael Andrade 2013 年 12 月 5 日
Hello.
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?
Thanks.
Rafael

回答 (1 件)

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2021 年 8 月 9 日
This would not be that difficult,
marble = imread('https://upload.wikimedia.org/wikipedia/commons/f/f3/SierraXenolith.JPG');
imagesc(marble)
marble2 = marble(:,:,2)<120;
imagesc(marble2)
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 ...

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by