_ Euclidean : D(p,q) = sqrt( (px-qx)^2 + (py-qy)^2 )
_ City-Block: D(p,q) = |px-qx| + |py-qy|
_ Chessboard: D(p,q) = max( |px-qx| , |py-qy| )
Disks in each one of the above metrics are respectively circles, diamonds and squares. For a concise review of this subject, see Gonzales & Wintz, "Digital Image Processing", chapter 2.
The disks generated may be planar or nonplanar, 2-dimensional or 3-dimensional. The default is euclidean planar 2-D.
The offset makes sense only for the nonplanar case, in which case the value specified is added to the element. If no offset or 0 is specified, the element values will be adjusted so as to have zero in the borders. For example, a 5x5 chessboard nonplanar 2-D element will look like this: 0 0 0 0 0 0 1 1 1 0 0 1 2 1 0 0 1 1 1 0 0 0 0 0 0
The disk-like structuring elements are very useful in many morphological operations such as distance transforms, granulometry, skeleton algorithms etc.
vdiskstr -r 3 -t "city-block"
Creates a 2-D disk-like structuring element of radius 3 according to the city-block metric.