Filter löschen
Filter löschen

How extract skull by morphological opening operation ?

1 Ansicht (letzte 30 Tage)
marwa za
marwa za am 1 Mai 2017
Kommentiert: hmi amid am 8 Mai 2017
How to make a morphological opening operation to extract the skull like this:

Akzeptierte Antwort

hmi amid
hmi amid am 1 Mai 2017
Hi,
You should read a bit about morphological operations to help you understand this. This is an example of code you can use.
A=imread('image.png');
A=A(:,:,1); % Make it grayscale
BW=A>50; % Thresholding at gray level of 50
disk_radius=2; % radius of the structure element in pixels (you can change that)
se = strel('disk',disk_radius); % Create a structure element shaped like a disk with a given radius
res = imopen(BW,se); % Morphological opening operation
output = uint8(double(res).*double(A)); % This operation takes all pixels of A where res is equal to 1
imshow(output)
Amid.
  2 Kommentare
marwa za
marwa za am 1 Mai 2017
Yes I already use the imopen function but it does not give a good result for extraction of the skull
hmi amid
hmi amid am 8 Mai 2017
You should adapt your disk_radius. In my case I had a very small example (it was the example you gave in the question and it had a small size). Try bigger disk radius, it would probably work. And also, you can change the shape, make it a square for example like this
se = strel('square',square_size);
Amid.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by