You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Boundary Extraction

From EverybodyWiki Bios & Wiki



Boundary Extraction is a Digital Image Process to extract edges from a binary image. It has also been used as the basis for extracting edges on grayscale and color images.[1]

Mathematical Definition[edit]

Example Boundary Extraction where 1’s represents white and 0’s represents black. a) Original Binary Image b) Structuring Element c) Original Image eroded by the Structuring Element d) Original image minus the eroded image

The below equation represents the mathematical process, where A is the original binary image and B is the structuring element.

1.    Erode A by B

2.    Subtract result from step 1 from original binary image A

Many different variations can exist for the structuring element B. The most popular consists of all 1’s.[2] As the size of B changes so will the thickness of the extracted boundary.

MATLAB Code[edit]

%% ---------------
% Boundary Extraction
% ---------------
img = imread('Boundary_Extraction.tif');

% Structuring Elements
B3 = [ 1 1 1;...
       1 1 1;...
       1 1 1];
B5 = [ 1 1 1 1 1;...
       1 1 1 1 1;...
       1 1 1 1 1;...
       1 1 1 1 1;...
       1 1 1 1 1];
B10 = [ 1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1;...
        1 1 1 1 1 1 1 1 1 1];

% Erosion
img_3 = imerode(b_img, B3);
img_5 = imerode(b_img, B5);
img_10 = imerode(b_img, B10);

% Subtraction
img3 = b_img-img_3;
img5 = b_img-img_5;
img10 = b_img-img_10;

% Figure Display
figure('Name', 'Boundary Extration');
subplot(2,2,1);
imshow(b_img);
title(sprintf('Original Binary Image'));
subplot(2,2,2);
imshow(img3);
title(sprintf('Boundary Extraction using 3x3'));
subplot(2,2,3);
imshow(img5);
title(sprintf('Boundary Extraction using 5x5'));
subplot(2,2,4);
imshow(img10);
title(sprintf('Boundary Extraction using 10x10'));

MATLAB Example[edit]

Original image for MATLAB Boundary Extraction example

In the image below, image in the upper left is the original image in which we apply the MATLAB code to produce the next three images. The image in the top right is using a 3x3 matrix composed of all 1’s as the structuring element. The image in the bottom left is using a 5x5 matrix with all 1’s and in the bottom right using a 10x10 matrix. As a result of the increased structuring element as we move towards the bottom right the thickness of the boarders also increases.   

See Also[edit]

References[edit]

  1. Louverdis, G; Vardavoulia, M.I.; Andreadis, I.; Tsalides, Ph. (2002). "A new approach to morphological color image processing". Pattern Recognition. 35: 1733-1741.
  2. Gonzalez, Rafael C.; Woods, Richard E. (2008). Digital image processing (3rd ed.). Upper Saddle River, N.J.: Prentice Hall. ISBN 978-0131687288. Search this book on


This article "Boundary Extraction" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Boundary Extraction. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.