Create Binary Rasters by Automatic Thresholds

Use the Binary Raster by Automatic Threshold tool to create a binary image using a predefined thresholding method. Thresholds are calculated for each band in the source image. Image thresholding is typically done to separate "object" or foreground pixels from background pixels to aid in image processing.

You can write a script to create binary rasters by automatic thresholds using the BinaryAutomaticThresholdRaster task.

Follow these steps:

  1. From the Toolbox, select Raster Management > Binary Raster by Automatic Threshold.
  2. Select a single-band or multi-band Input Raster, and perform optional spatial and/or spectral subsetting.
  3. Select a thresholding method from the Method drop-down list. The choices are:
  4. The Inverse option is set to No by default, which means that values above the computed threshold are set to 1 and all other values are set to 0. Set this option to Yes to invert the values.
  5. To write the output to disk, select the File radio button and specify a filename and location. To produce output in memory only, select the Virtual radio button.

  6. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  7. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  8. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  9. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  10. Click OK.

References

Glasbey, C. "An Analysis of Histogram-Based Thresholding Algorithms." CVGIP: Graphical Models and Image Processing 55 (1993): 532-537.

Kapur, J., P. Sahoo, and A. Wong. "A New Method for Gray-Level Picture Thresholding Using the Entropy of the Histogram." Graphical Models and Image Processing 29, No. 3 (1985): 273-285.

Kittler, J., and J. Illingworth. "Minimum Error Thresholding." Pattern Recognition 19 (1986): 41-47.

Otsu, N. "A Threshold Selection Method from Gray-Level Histograms." IEEE Transactions on Systems, Man and Cybernetics 9 (1979): 62–66.

Ridler, T., and S. Calvard. "Picture Thresholding Using an Iterative Selection Method." IEEE Transactions on Systems, Man and Cybernetics 8 (1978): 630 - 632.

Tsai, W. "Moment-Preserving Thresholding: a New Approach." Computer Vision, Graphics, and Image Processing 29 (1985): 377-393.