Image processing k-mean clustering
Mostra commenti meno recenti
I have an x-ray image and need to segment it using k-mean clustering method. I would like to have two main clusters, (1) the background in blue color and (2) the circles (bubbles)+ long keyhole shape cavity with yellow color. In image "Picture 3" , I indicated what I mean by the bubbles and keyhole that need to be labeled with yellow. However, as the background is not smooth and has scratch lines, the labeled image is not done perfectly. For example , the long keyhole shape is intermittently labeled. I used two types of filters: Flat field correction and Gaussian filter to smooth the background a little bit but was not very helpful. Especially the long keyhole shape will be labeled to several segments as I increased the value of sigma in the filters.
Any suggestions will be appreciated.
clc;clear all; close all;
sigma1=100; % value of sigma2 for gussian filtering
sigma2=1; % value of sigma1 for gussian filtering
img_00=imread('Capture2.jpg');
imshow(img_00)
img_00 = imgaussfilt(img_00,sigma2); % appliying gussian filter 0.5 is default
img_00=imflatfield(img_00,sigma1); % applying image flattening
[L,Centers] = imsegkmeans(img_00,2); % use k-maen clustering to find out keyhole and bubbles, used 2 clusters
B = labeloverlay(img_00,L); % overlay the clustering on the original image
imshow(B)
Risposta accettata
Più risposte (1)
Sam J
il 16 Set 2022
1 voto
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


