Skip To Content

Remove Raster Segment Tiling Artifacts

Available with Spatial Analyst license.

Available with Image Analyst license.

Summary

Some regional processes, such as image segmentation, will have inconsistencies near image tile boundaries. This tool corrects segments or objects cut by tile boundaries during the segmentation process performed as a raster function.

This processing step is already 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.sa import *

refined_seg_raster = arcpy.sa.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.sa import *

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

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

# Execute 
refined_seg_raster = arcpy.sa.RemoveRasterSegmentTilingArtifacts(inRaster, tile_width, tile_height)

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

Licensing information

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

Related topics