Hello, I am trying to extract Building Footprints From Satellite Imagery,I have applied Morphological functions. But i am not able to separate buildings from roads and trees Present in urban areas
Afficher commentaires plus anciens
I=imread('rq_subset.tif'); %Read in image
im1=rgb2gray(I); % conversion frm RGB to Gray Image
figure,imshow(I);
level = graythresh(im1); % calculates threshold values using ostu's method
bw=im2bw(im1,level); %Convert image to binary image, based on threshold
figure,imshow(bw);
se = strel('square',2); %structure element Morphological unit
bw1 = imerode(bw,se); % morphological opening
figure, imshow(bw1);% display of image with structure element
bw3 = imdilate(bw1,se);
imshow(bw3);
b6=bwmorph(bw3,'remove'); % removes elements from inside the body
figure,imshow(b6);
B1=strel('rectangle',[4,2]);
B2=strel ('rectangle',[2,1]);
%se1=strel('square',4);
bw4=bwhitmiss(bw3,B1,B2);
figure,imshow(bw4);
se=strel('square',1);
bw5=imerode(bw4,se);
figure,imshow(bw5);
1 commentaire
shantanu shukla
le 17 Avr 2014
Rajat if u have the code for building extraction please share with me i really need it very much
Réponses (0)
Catégories
En savoir plus sur Morphological Operations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!