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
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
shantanu shukla
2014-4-17
Rajat if u have the code for building extraction please share with me i really need it very much
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!