can you help us for area segmentation method on temporal bone object to segment the region marked with arrows

1 visualizzazione (ultimi 30 giorni)
can you help us for area segmentation method on temporal bone object to segment the region marked with arrows
Thank you

Risposte (2)

Image Analyst
Image Analyst il 28 Set 2021
Did you try thresholding? See attached demo. Adapt as needed.

yanqi liu
yanqi liu il 28 Set 2021
sir,please check the follow code to get some information
clc; clear all; close all;
im = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/751599/image.jpeg');
im = rgb2gray(im);
% make bw
bw = imbinarize(im,'adaptive','ForegroundPolarity','dark','Sensitivity',0.85);
% choose target
bw2 = imfill(bw, 'holes'); bt = imclose(bw2, strel('disk', 2));
bw2 = imfill(bt, 'holes');
bw2 = imopen(bw2, strel('disk', 10));
bw2(:,round(size(bw2,2)/2):end)=0;
bw2 = bwareafilt(logical(bw2),1);
bt = logical(bw.*bw2);
bt2 = ~bt; bt2 = imclearborder(bt2);
bt(bt2) = 0;
bt = logical(bt);
bt = bwareaopen(bt, 80);
bt = imclose(bt, strel('disk', 20));
bt(bt2) = 0;
bt = logical(bt);
% make result
im1 = im; im2 = im; im3 = im;
im1(bt) = 255; im2(bt) = 0; im3(bt) = 0;
imr = cat(3,im1,im2,im3);
% display
figure; imshow(imr, []);
  13 Commenti
Syafri Arlis
Syafri Arlis il 5 Gen 2022
@yanqi liu We are trying to separate the left and right areas, according to the attached image, can you help me?, thank you
yanqi liu
yanqi liu il 5 Gen 2022
clc; clear all; close all;
img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/853405/image.png');
im = imcrop(img, [24 88 379 219]);
im = rgb2gray(im);
bw = im2bw(im);
bw = imclose(bw, strel('disk', 19));
[L,num] = bwlabel(bw);
stats = regionprops(L);
rects = cat(1, stats.BoundingBox);
[~,ind] = sort(rects, 1);
im1 = im; im2 = im;
im1(L~=ind(1)) = 0; im2(L~=ind(2)) = 0;
figure;
subplot(1,3,1); imshow(im, []);
subplot(1,3,2); imshow(im1, []); title('left');
subplot(1,3,3); imshow(im2, []); title('right');

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by