Generate Exclude Area (Data Management)

Summary

Allows you to set the exclude area, based on color mask or histogram percentage. The output of this tool can then be used within the Color Balance Mosaic Dataset tool.

Usage

Syntax

GenerateExcludeArea_management (in_raster, out_raster, {pixel_type}, {generate_method}, {max_red}, {max_green}, {max_blue}, {max_white}, {max_black}, {max_magenta}, {max_cyan}, {max_yellow}, {percentage_low}, {percentage_high})
ParameterExplanationData Type
in_raster

The file path and file name of the input raster. Valid inputs include raster layers and mosaic datasets layers.

Mosaic Dataset; Composite Layer; Raster Dataset; Raster Layer
out_raster

The file path and file name of the input raster. The output will be a raster dataset.

The output can then be used as the Exclude Area Raster parameter within the Color Balance Mosaic Dataset tool.

Raster Dataset
pixel_type
(Optional)

Choose the pixel depth of your input raster dataset. This parameter is important, since any pixel depth above 8-bit will need to have the color mask and histogram values adjusted.

  • 8_BITYour input raster dataset has values from 0 to 255. This is the default.
  • 11_BITYour input raster dataset has values from 0 to 2047.
  • 12_BITYour input raster dataset has values from 0 to 4095.
  • 16_BITYour input raster dataset has values from 0 to 65535.
String
generate_method
(Optional)

Choose which method you want to use to exclude areas of your input.

  • COLOR_MASKAllows you to set the maximum color values to exclude in the output. This is the default.
  • HISTOGRAM_PERCENTAGEAllows you to set the minimum and maximum histogram percentage of pixels.
String
max_red
(Optional)

This is the maximum red value to exclude. The default is 255.

Double
max_green
(Optional)

This is the maximum green value to exclude. The default is 255.

Double
max_blue
(Optional)

This is the maximum blue value to exclude. The default is 255.

Double
max_white
(Optional)

This is the maximum white value to exclude. The default is 255.

Double
max_black
(Optional)

This is the maximum black value to exclude. The default is 0.

Double
max_magenta
(Optional)

This is the maximum magenta value to exclude. The default is 255.

Double
max_cyan
(Optional)

This is the maximum cyan value to exclude. The default is 255.

Double
max_yellow
(Optional)

This is the maximum yellow value to exclude. The default is 255.

Double
percentage_low
(Optional)

This is the minimum percentage of the histogram to exclude. The default is 0.

Double
percentage_high
(Optional)

This is the maximum percentage of the histogram to exclude. The default is 100.

Double

Code Sample

GenerateExcludeArea example 1 (Python window)

This is a Python sample for GenerateExcludeArea.

import arcpy
GenerateExcludeArea_management("C:/workspace/fgdb.gdb/mosdata",
                               "C:/workspace/excludeArea.tif","8_BIT",
                               "COLOR_MASK","255","255","255","255","15",
                               "255","255","255","0","100")
GenerateExcludeArea example 2 (stand-alone script)

This is a Python script sample for GenerateExcludeArea.

##===========================
##Generate Exclude Area
##Usage: GenerateExcludeArea_management in_raster out_raster 8_BIT | 11_BIT | 
##                                      12_BIT | 16_BIT COLOR_MASK | HISTOGRAM_PERCENTAGE
##                                      {max_red} {max_green} {max_blue} {max_white} 
##                                      {max_black} {max_magenta} {max_cyan}
##                                      {max_yellow} {percentage_low} {percentage_high}

try:
    import arcpy
    arcpy.env.workspace = "c:/workspace"
    
    # Generate exclude area dataset from raster dataset with Histogram
    arcpy.GenerateExcludeArea_management("srcimage.tif", "exarea.tif", "8_BIT",
                                         "HISTOGRAM_PERCENTAGE", "", "", "", "",
                                         "", "", "", "", "10", "100")                                      
    
    # Generate exclude area dataset from mosaic dataset with Color Mask
    arcpy.GenerateExcludeArea_management("CC.gdb/srcmd", "exarea.tif", "8_BIT",
                                         "COLOR_MASK", "255", "200", "50", "255",
                                         "10", "210", "100", "255", "", "") 
    
    
except:
    print "Generate Exclude Area example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

10/27/2014