Remove Raster Segment Tiling Artifacts (Image Analyst)

Available with Spatial Analyst license.

Available with Image Analyst license.

Summary

Corrects segments or objects cut by tile boundaries during the segmentation process performed as a raster function. This tool is helpful for some regional processes, such as image segmentation, that have inconsistencies near image tile boundaries.

This processing step is included in the Segment Mean Shift tool; therefore, it should only be used on a segmented image that was not created from that tool.

Usage

  • This tool can be used with the Generate Raster from Raster Function geoprocessing tool, which allows you to use the segmentation raster function in a parallel processing environment and write the output to disk.

Syntax

RemoveRasterSegmentTilingArtifacts(in_segmented_raster, {tileSizeX}, {tileSizeY})
ParameterExplanationData Type
in_segmented_raster

Select the segmented raster with the tiling artifacts that you want to remove.

Raster Dataset; Mosaic Dataset; Raster Layer; Mosaic Layer; Image Service; String
tileSizeX
(Optional)

Specify the tile width from Segment Mean Shift. If left blank, the default is 512 pixels.

Long
tileSizeY
(Optional)

Specify the tile height from Segment Mean Shift. If left blank, the default is 512 pixels.

Long

Return Value

NameExplanationData Type
out_raster_dataset

The path and name of the segmented raster from which you are removing tiling artifacts.

Raster

Code sample

RemoveRasterSegmentTilingArtifacts example 1 (Python window)

This example removes raster tiling segments.

import arcpy
from arcpy.ia import *

# Check out the ArcGIS Image Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")

refined_seg_raster = RemoveRasterSegmentTilingArtifacts("C:/test/segmented_raster.tif","512","512")

refined_seg_raster.save("C:/test/refined_segmented_raster.tif")
RemoveRasterSegmentTilingArtifacts example 2 (stand-alone script)

This example removes raster tiling segments.

# Import system modules
import arcpy
from arcpy.ia import *

# Set local variables
inRaster = "C:/test/segmented_raster.tif"
tile_width = "512"
tile_height = "512"

# Check out the ArcGIS Image Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")

# Execute 
refined_seg_raster = RemoveRasterSegmentTilingArtifacts(inRaster, tile_width, tile_height)

# Save the output 
refined_seg_raster.save("C:/test/refined_segmented_raster.tif")

Licensing information

  • Basic: Requires Image Analyst or Spatial Analyst
  • Standard: Requires Image Analyst or Spatial Analyst
  • Advanced: Requires Image Analyst or Spatial Analyst

Related topics