Determining Structuring Element Shapes and Sizes
Determining the size and shape of a structuring element is largely an empirical process. However, the overall selection of a structuring element depends upon the geometric shapes you are attempting to extract from the image data. For example, if you are dealing with biological or medical images, which contain few straight lines or sharp angles, a circular structuring element is an appropriate choice. When extracting shapes from geographic aerial images of a city, a square or rectangular element will allow you to extract angular features from the image.
While most examples in this chapter use simple structuring elements, you may need to create several different elements or different rotations of a singular element in order to extract the desired shapes from your image. For example, if you wish to extract the rectangular roads from an aerial image, the initial rectangular element will need to be rotated a number of ways to account for multiple orientations of the roads within the image.
The size of the structuring element depends upon what features you wish to extract from the image. Larger structuring elements preserve larger features while smaller elements preserve the finer details of image features.
The following table shows how to easily create simple disk-shaped, square, rectangle, diagonal and custom structuring elements using IDL. The visual representations of the structures, shown in the right-hand column, indicate that the shape of each binary structuring element is defined by foreground pixels having a value of one.
|
IDL Code For Structuring Element Shapes
|
Examples
|
|---|---|
| Disk-Shaped Structuring Element Use SHIFT in conjunction with DIST to create the disk shape. Change radius to alter the size of the structuring element. |
![]()
|
| Square Structuring Element Use DIST to define the square array. Change side to alter the size of the structuring element. |
![]()
|
| Vertical Rectangular Structuring Element Use BYTARR to define the initial array.
Create a 2 x 3 structure by adding |
![]()
|
| Horizontal Rectangular Structuring Element Use BYTARR to define the initial array.
Create a 3 x 2 structure by adding, |
![]()
|
| Diagonal Structuring Element Use IDENTITY to create the initial array. Note - BYTE is used to create a byte array, consistent with the other structuring elements. |
![]()
|
| Irregular Structuring Elements Define custom arrays to create irregular structuring elements or a series of rotations of a single structuring element. strucElem = [[1,0,0,0,0,0,1], $ [1,1,0,0,0,1,1], $ [0,1,1,1,1,1,0], $ [0,0,1,1,1,0,0], $ [0,0,1,1,1,0,0], $ [0,1,1,0,1,1,0], $ [1,1,0,0,0,1,1], $ [1,0,0,0,0,0,1]] Note - Creating a series of rotations of a single structuring element is covered in Thinning Image Objects. |
![]()
|





