Select to view content in your preferred language

segment mean shift raster function

1929
2
10-27-2017 10:31 AM
LyleBoychuk
Emerging Contributor

I am working in ArcGIS Pro 2 with Segment Mean Shift (MSM) Raster function with a subset of 4 band imagery Mosaic Dataset Clipped to my current extend with the CLIP raster function.   When I run the Segment Mean Shift function is immediately toss the "Failed to apply Segment Mean Shift to selected layers(s)" error msg.  However when I use the MSM Geoprocessing Tool the segmentation is generated from the same imagery.   What is causing this error with the raster function?  

Lyle

0 Kudos
2 Replies
ChrisDonohue__GISP
MVP Alum

Tagging https://community.esri.com/community/gis/imagery-and-remote-sensing  for greater exposure

Chris Donohue, GISP

0 Kudos
ThomasMaurer
New Contributor

The SegmentMeanShift raster function only takes 3 band 8 bit input. It was developed originally for RGB images. Add the ExtractBandFunction first to pick the 3 bands you want to use. This can be RGB, but you can also create a false color image using the IR band + 2 other bands. It depends on the task, what you want to do or classify in the end. Choose the 3 bands such that things you want to distinguish later are as different in color as possible. On top of ExtractBandFunction, add SegmentMeanShift function and it should work fine.

If you have input 16 bit not 8 bit, add Stretch function to scale pixel values down to 8 bit.

In general, play with ExtractBands and Stretch and their params until you like the intermediate, 3 band 8 bit false color image. Then apply Segment on that result.

The Segment gp tool is more forgiving. Main reason is other gp tools also allow many bands many bits on input. Price to pay is we get some inconsistency between Segment gp tool and Segment raster function.

Hope that helps. Best, Tom.