Effacer les filtres
Effacer les filtres

need to extract the road segment part , but don't know which filter is good for removing the noise

2 vues (au cours des 30 derniers jours)
he=imread('r15.jpg'); figure, imshow(he);
if ndims(he)==3 I1=rgb2gray(he); else I1=double(he); end
cform = makecform('srgb2lab');
lab_he = applycform(he,cform);
ab = double(lab_he(:,:,2:3)); nrows = size(ab,1); ncols = size(ab,2); ab = reshape(ab,nrows*ncols,2);
nColors = 3; % repeat the clustering 3 times to avoid local minima [cluster_idx, cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ... 'Replicates',3); pixel_labels = reshape(cluster_idx,nrows,ncols); figure,imshow(pixel_labels,[]), title('image labeled by cluster index');
segmented_images = cell(1,3); rgb_label = repmat(pixel_labels,[1 1 3]);
for k = 1:nColors color = he; color(rgb_label ~= k) = 0; segmented_images{k} = color;
end a= segmented_images{1}; c=rgb2gray(a); %I=imcomplement(a); %b = bwareaopen(c,10); figure,imshow(c), title('objects in cluster 1');
  1 commentaire
shantanu shukla
shantanu shukla le 24 Avr 2014
Modifié(e) : shantanu shukla le 24 Avr 2014
output of the code is. plz suggest me appropriate solution to get the good quality output

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by