Segmentation of B/W image

1 回表示 (過去 30 日間)
Naman Agrawal
Naman Agrawal 2019 年 8 月 31 日
編集済み: Subhadeep Koley 2019 年 9 月 4 日
Hi, I want to segment out the bone-discs of the Given image Im2bw etc but not getting the disc seperated can Anyone help me out in this?? have tried almost everything from changing the contrast of the image then gray leveling, imsharpen can anyone help me out in this question??
The Given image is-
TIA
PR.jpg
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 8 月 31 日
"segment out the bone-discs of the Given image"
Can you show us the ROI (use paint or any image editing tool)?

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

回答 (1 件)

Subhadeep Koley
Subhadeep Koley 2019 年 9 月 4 日
編集済み: Subhadeep Koley 2019 年 9 月 4 日
It is difficult to exactly segment out only the bone-disc area using standard segmentation techniques. The following function might help you.
function [BW] = segmentImage(X)
% X = Input image
% BW = Output binary mask for segmentation
% Auto clustering using K-means algorithm
s = rng;
rng('default');
L = imsegkmeans(single(X),2,'NumAttempts',2);
rng(s);
BW = L == 2;
% Open mask with rectangle
dimensions = [7 7];
se = strel('rectangle', dimensions);
BW = imopen(BW, se);
% Fill holes
BW = imfill(BW, 'holes');
end
Fig 1. Original Image Fig 2. Binary mask for segmentation

Community Treasure Hunt

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

Start Hunting!

Translated by