Remove Raster Segment Tiling Artifacts (Spatial 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; 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.

Parameters

LabelExplanationData Type
Input Segmented RGB Or Gray 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
Tile width used for segmentation
(Optional)

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

Long
Tile height used for segmentation
(Optional)

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

Long

Return Value

LabelExplanationData Type
Output Segmented Raster

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

Raster

RemoveRasterSegmentTilingArtifacts(in_segmented_raster, {tileSizeX}, {tileSizeY})
NameExplanationData 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

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

Related topics