1 / 17

Morphology Image Processing‏

Morphology Image Processing‏. Lab 6. Dilation & Erosion. Function strel. Create morphological str ucturing el ement (STREL), with a variety of shapes and sizes. se = strel ( shape,parameters );. imdilate example with binary. >> bw = imread ('text.png'); >>se = strel ('line',11,90);

oistin
Download Presentation

Morphology Image Processing‏

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Morphology Image Processing‏ Lab 6

  2. Dilation & Erosion

  3. Function strel • Create morphological structuring element (STREL), with a variety of shapes and sizes. se = strel(shape,parameters);

  4. imdilate example with binary >>bw= imread('text.png'); >>se = strel('line',11,90); >>bw2 = imdilate(bw,se); >>imshow(bw), title('Original'), figure, imshow(bw2), title('Dilated');

  5. imdilate example with grayscale >>I = imread('cameraman.tif'); >>se = strel(‘rectangle',[5,5]); >>I2 = imdilate(I,se); >>imshow(I), title('Original'),figure, imshow(I2), title('Dilated');

  6. imerode example with binary >>originalBW= imread('circles.png'); >>se = strel('disk',11); >>erodedBW= imerode(originalBW,se); >>imshow(originalBW), figure, imshow(erodedBW)

  7. imerode example with grayscale >>I = imread('cameraman.tif'); >> se=strel('rectangle',[5,5]); >>I2 = imerode(I,se); >>imshow(I), title('Original'), figure, imshow(I2), title('Eroded‘);

  8. imdilate, imerode Example >> BW = imread('circbw.tif'); >> se=strel('square',3); >> BWD = imdilate(BW,se); >> BWE = imerode(BW,se); >>imshow(BW),figure,imshow(BWD),figure,imshow(BWE);

  9. Combining Dilation & Erosion • The most common combinations of dilation and erosion: • opening. • closing.

  10. imopen Example • This example uses imopen to filter out the smaller objects in an image. >> I = imread('snowflakes.png'); • Create a disk-shaped structuring element with a radius of 5 pixels. >>se = strel('disk',5); • Remove snowflakes having a radius less than 5 pixels by opening it with the disk-shaped structuring element. >> I_opened = imopen(I,se); >>Imshow(I), figure, imshow(I_opened,[]);

  11. imclose example • This example uses imclose to join the circles in the image together by filling in the gaps between them and by smoothening their outer edges. >>originalBW = imread('circles.png'); • Create a disk-shaped structuring element. Use a disk structuring element to preserve the circular nature of the object. Specify a radius of 10 pixels so that the largest gap gets filled. >>se = strel('disk',10); >>closeBW = imclose(originalBW,se); >> imshow(originalBW),figure, imshow(closeBW);

  12. Some morphological operations • There are a variety of morphological operations based on combinations of dilations, erosions, and lookup table operations: • Thickening. • Thinning. • Skeletonization. • These operations can be accomplished by bwmorph function in matlab.

  13. bwmorph • g = bwmorph( i , operation , n) • i  the input image(should be black&white) • operation  string specifying the operation • n  number of times the operation should be repeated. • If n is ommited  n=1 • If n = Inf  repeat the operation until the image stops changing. (should used with ‘skel’)

  14. Examples BW1 = imread('circbw.tif'); BW2 = bwmorph(BW1,'skel',Inf); imshow(BW1) ,figure, imshow(BW2); BW = imread('circles.png'); BW2 = bwmorph(BW,'skel',Inf); imshow(BW) ,figure, imshow(BW2);

More Related