Delta Mask

The delta mask formulae is an alternative technique to partition roots imaged in the 3D system. The goal of the delta mask is to emphasize white regions of an image, which constitute primarily of the plant roots. The processing steps are based, in part, on the equation for converting RGB to hue, saturation and luminance (HSL).


  1. Calculate max/min grayscale arrays
  2. Calculate the range array
  3. Binarize min and range array
  4. Join min and range arrays
  5. Blackout border
  6. Remove dust
  7. Dilate

Color to max, min and range

The first processing step is to calculate the maximum (max) and minimum (min) arrays based on the largest and smallest RGB brightness value for each pixel in the original color image, respectively. The range array is calculated based on the difference between the max and min arrays.

Original color image Delta mask max Delta mask min Delta mask range

Figure 1. (left to right) Color image; max array; min array; range array.

The min array, which represents the lowest brightness value of each pixel, mutes all colors except for whites and grays (i.e., where all three color bands are of equal brightness). The range array emphasizes primary and secondary colors, where, of the three color bands, at least one band has a high and one band has a low brightness value. It can be seen, therefore, that the min and range arrays highlight opposing features of a color image, which will be exploited for creating the delta mask.

Binarize and join

The min and range arrays are converted to binary based on Otsu's method (Otsu, 1979). The binary min and range arrays are then joined to form the mask array.

Delta mask binary range Delta mask binary min Delta mask join

Figure 2. (left to right) Binary range, min and mask arrays

Border, filter and dilate

A border may be prescribed to manually black out regions surrounding the region of interest. The border is defined by the relative extents of the region of interest, which by default spans from 0-100% from top to bottom and left to right. Extents are relative to the top-left corner (0%, 0%).

Additionally, a dust-removal algorithm may be employed to further remove specks or unwanted noise from the region of interest. The binarized and bordered image is scanned for white pixels. White pixels are grouped into clusters based on a nearest-neighbor search algorithm. Pixel clusters that are smaller than the prescribed size are removed from the binary image.

Finally, the mask may be expanded by applying a number of dilation iterations. Each iteration grows the mask by a single pixel width.

Delta mask border Delta mask dust removal Delta mask dilation

Figure 3. (left to right) Bordered binary image, dust-filtered binary image, and dilated binary image following five iterations

Applying the mask

Once the delta mask is created (e.g., Fig. 3, right), it is overlaid onto the original color image. The masked color image is converted to grayscale based on the standard luminance equation. The masked grayscale image is finally converted to binary, once again based on the Otsu method.

Delta mask over RGB Delta mask grayscale Delta mask binary

Figure 4. (left to right) Original color image overlaid by the delta mask, masked grayscale image, and masked binary image