GBDX

ENVI® Auto Change Threshold Classification

This task uses pre-defined thresholding techniques to automatically classify change detection between two images.

GBDX Registered Name: ENVI_AutoChangeThresholdClassification
Provider: Harris Geospatial Solutions

For more information on how to execute this task please refer to the ENVI® Task Engine.

Table of Contents

Section Description
Imagery Examples Before and after examples
Quickstart Get started with a Python-based quickstart tutorial
Task Runtime Benchmark runtimes for the algorithm
Input Options Required and optional task inputs
Outputs Task outputs and example contents
Advanced Options Additional information for advanced users
Known Issues Issues users should be aware of

Imagery Examples

This task automatically classifies change detection between two images, so two input rasters are required.

Before: First of two Input images that wil be compared when Auto Change Threshold Classification is run

Before: First of two Input images that wil be compared when Auto Change Threshold Classification is run

Before: Second of two Input images that wil be compared when Auto Change Threshold Classification is run

Before: Second of two Input images that wil be compared when Auto Change Threshold Classification is run

After: Output of ENVI Auto Change Threshold Classification is run

After: Output of ENVI Auto Change Threshold Classification is run

Quickstart Tutorial

Example Script: Run in a python environment (i.e. - IPython) using the gbdxtools interface.

from gbdxtools import Interface
gbdx = Interface()

# Edit the following path to reflect a specific path to an image
NDVI1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'
NDVI2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'

envi_IBD = gbdx.Task("ENVI_ImageBandDifference")
envi_IBD.inputs.input_raster1 = NDVI1
envi_IBD.inputs.input_raster2 = NDVI2

envi_ACTC = gbdx.Task("ENVI_AutoChangeThresholdClassification")
envi_ACTC.inputs.input_raster = envi_IBD.outputs.output_raster_uri.value


workflow = gbdx.Workflow([envi_IBD, envi_ACTC])

workflow.savedata(
    envi_ACTC.outputs.output_raster_uri,
        location='AutoChangeThreshold/output_raster_uri'
)

print workflow.execute()
print workflow.status
# Repeat workflow.status as needed to monitor progress.

Task Runtime

These are the average runtimes for this algorithm. All benchmark tests were run using a standard set of images, based on our most common customer scenarios. Runtime benchmarks apply to the specific algorithm, and don’t represent the runtime of a complete workflow.

Sensor Name Total Pixels Total Area (k2) Time(secs) Time/Area k2
WV02 73,005,420 292.02 169.60 0.58

Input Options

The following table lists all inputs for this task. For details regarding the use of all ENVI input types refer to the ENVI® Task Engine documentation.

Name Required Default Valid Values Description
input_raster True None A valid S3 URL containing image files. Specify a raster from which to run the task. -- Value Type: ENVIRASTER
input_raster_format False None See ENVIRASTER input type Provide the format of the image, for example: landsat-8. -- Value Type: STRING
input_raster_band_grouping False None See ENVIRASTER input type Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING
input_raster_filename False None See ENVIRASTER input type Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING
input_raster_raw_output False False See ENVIRASTER input type Provide True to output an ENVI Binary instead of a tif. -- Value Type: STRING
change_type False 'Both' 'Increase', 'Decrease', 'Both' The type of change to consider for change of interest -- Value Type: STRING
threshold_method False 'Otsu' 'Otsu', 'Tsai', 'Kapur', 'Kittler' Specify the thresholding method. -- Value Type: STRING
output_raster_uri_filename False None string Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING

Description of Auto Threshold Methods

Name Description
Otsu A histogram shape-based method that is based on discriminate analysis. It uses the zero- and first-order cumulative moments of the histogram for calculating the value of the thresholding level.
Tsai A moment-based method. It determines the threshold so that the first three moments of the input image are preserved in the output image.
Kapur An entropy-based method. It considers the thresholding image as two classes of events, with each class characterized by a Probability Density Function (PDF). The method then maximizes the sum of the entropy of the two PDFs to converge on a single threshold value.
Kittler A histogram shape-based method. It approximates the histogram as a bimodal Gaussian distribution and finds a cutoff point. The cost function is based on the Bayes classification rule.

Outputs

The following table lists all outputs from this task.

Name Required Description
output_raster_uri True Output for OUTPUT_RASTER.
task_meta_data False GBDX Option. Output location for task meta data such as execution log and output JSON.
Output Structure

The output_raster image file will be written to the specified S3 Customer Account Location in GeoTiff (*.tif) format, with an ENVI header file (*.hdr).

Advanced Options

This task will take two multispectral images, which share geo-spatial extent, as input. This example workflow includes the following ENVI tasks to prepare the images for the Change Threshold Classification task: Spectral Index, Image Intersection, and Image Band Difference. Input rasters for the Change Threshold Classification task may be any set of 1 band rasters sharing the same extent, spatial reference and pixel value format (e.g. Normalized Difference Vegetation Index).

from gbdxtools import Interface
gbdx = Interface()

# Edit the following path to reflect a specific path to an image
data1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'
data2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'


aoptask1 = gbdx.Task("AOP_Strip_Processor") 
aoptask1.inputs.data = data
aoptask1.inputs.enable_dra = False
aoptask1.inputs.bands = 'MS'

aoptask2 = gbdx.Task("AOP_Strip_Processor") 
aoptask2.inputs.data = data
aoptask2.inputs.enable_dra = False
aoptask2.inputs.bands = 'MS'


envi_ndvi1 = gbdx.Task("ENVI_SpectralIndex")
envi_ndvi1.inputs.input_raster = aoptask1.outputs.data.value
envi_ndvi1.inputs.index = "Normalized Difference Vegetation Index"

envi_ndvi2 = gbdx.Task("ENVI_SpectralIndex")
envi_ndvi2.inputs.input_raster = aoptask2.outputs.data.value
envi_ndvi2.inputs.index = "Normalized Difference Vegetation Index"

envi_II = gbdx.Task("ENVI_ImageIntersection")
envi_II.inputs.input_raster1 = envi_ndvi1.outputs.output_raster_uri.value
envi_II.inputs.input_raster2 = envi_ndvi2.outputs.output_raster_uri.value
envi_II.inputs.output_raster1_uri_filename = "NDVI1"
envi_II.inputs.output_raster2_uri_filename = "NDVI2"

envi_IBD = gbdx.Task("ENVI_ImageBandDifference")
envi_IBD.inputs.input_raster1 = envi_II.outputs.output_raster1_uri.value
envi_IBD.inputs.input_raster2 = envi_II.outputs.output_raster2_uri.value

envi_ACTC = gbdx.Task("ENVI_AutoChangeThresholdClassification")
envi_ACTC.inputs.threshold_method = "Kapur"
envi_ACTC.inputs.input_raster = envi_IBD.outputs.output_raster_uri.value

workflow = gbdx.Workflow([
    aoptask1, aoptask2, envi_ndvi1, envi_ndvi2, envi_II, envi_IBD, envi_ACTC
])

workflow.savedata(
    envi_ACTC.outputs.output_raster_uri,
        location='AutoChangeThreshold/output_raster_uri' # edit location to suit account
)

print workflow.execute()
print workflow.status
# Repeat workflow.status as needed to monitor progress.

Known Issues

Input rasters for the ENVI_AutoChangeThresholdClassification task will require pre-processing to fit specific input requirements. Auto threshold may also require experimentation and iteration to find an acceptable threshold method (e.g. Kapur may not be the ideal method for a given raster dataset).

Background

For additional background information on this task please refer to the Harris Geospatial ENVI documentation.

Contact Us

If you have any questions or issues with this task, please contact gbdx-support@digitalglobe.com .