How do I perform Image segmentation in an RGB image using pattern?

I want to create 2 segment in the attached RGB interference image. 1 segment would be the horseshoe pattern as can be observed in the image and the other segment would be rest of the image. So far I have tried: Edge detection using Canny, Kmeans cluster, imsegkmeans.
The clustering is almost working, but I get cluster within a cluster due to the RGB values. I want to avoid that and have just two segments from the image.

 採用された回答

Matt J
Matt J 2026 年 3 月 16 日
編集済み: Matt J 2026 年 3 月 16 日
load Image
[r,g,b]=imsplit(I);
lev=multithresh(r,2);
L=imquantize(r,lev);
H=bwareafilt( imfill(L==2,'holes') ,1) ;
BG= L>1 & ~H;
L=H+2*BG;
immontage({I,L})

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2026 年 3 月 16 日

0 投票

You are pretty much doomed to failure if you want to segment the horseshoe pattern from the rest of the image. The rest of the image includes the black background, which will have such great differences in characteristics from the circle that any method you use for segmenting into exactly two regions is very likely to pick out the black background as one region and the entire circle as the second region.

1 件のコメント

Ammad Yousuf
Ammad Yousuf 2026 年 3 月 17 日
Thank you for your response. i cropped the original image that had fringes. Do you suggest I use the original image for this?

サインインしてコメントする。

製品

リリース

R2023a

質問済み:

2026 年 3 月 16 日

コメント済み:

2026 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by