Having trouble running Segement Mean Sift as Raster Function

4700
2
04-27-2016 11:21 AM
Labels (1)
MervynLotter
Occasional Contributor III

Hi there

I have successfully done this once before, but that was some time back and now I am struggling to run Segment Mean Shift as a raster function. It works just fine as a geoprocessing tool.

I guess I am missing an important step in the raster edit function chaining process.

I tried running the segment mean shift function on Mosaic Datasets created for both Sentinel 2 and Landsat imagery and I have tried to run this function in both ArcMap 10.4 and Pro 1.2 (and it always fails - so problem must lie with my approach).

1. As the Segment Mean Shift process needs to run 3 band imagery, my first step was to use the Extract Bands function to tease out 3 bands.  The output pixel type was 16 Bit Unsigned.

2. I then used the Stretch function and Standard Deviation to apply an appropriate stretch to my image (the 3 extracted bands). The Output Minimum is 0 and Output Maximum is 255 and the Pixel type is set to 8 Bit Unsigned.

3. I use the Clip function to limit the extent of my analysis, ensuring the output pixel type is still 8 Bit Unsigned.

Up to this stage, the imagery displays correctly in my map view (stretched, clipped, etc).

4. I apply the Segment Mean Shift function on my output from the Clip function and the map display is blank (not showing any results from function chain). Running the Validate  while in Raster Function Editor does not display any problems.  My input Raster is <Clip.OutputRaster> and output pixel type is still 8 Bit Unsigned.

If I use the output of my Clip function in the Segment Mean Shift geoprocessing tool (not as a raster function), then it works.

I am guessing I have missed a step or a setting in my raster edit function chain. Any advice?

Thanks,

Mervyn

0 Kudos
2 Replies
PeterBecker
Esri Regular Contributor

Mervyn

Your workflow seams correct. If you remove the clip does it then work. The raster function will only process the are on the screen and a buffer around it. Do check that the stretch being applied is based on the raster statistics and not DRA. Do also check what rendering is being applied on the output layer.  Failing that can you provide a sample?

_Peter

MervynLotter
Occasional Contributor III

Hi Peter

Thanks for your response.

After ruling out your suggestions and running this segmentation process as

a raster function MANY times, I think I have finally figured out the

problem.

*The data frame or map's reference system needs to be in the same

projection as that of the mosaic dataset. Then it works.*

On a different note, it would be nice if one day the raster Clip function

could honour the active definition query applied to a polygon layer used in

the Clip function.

And thanks to the imagery team for the great Sentinel2 python script! It is

awesome.

Cheers

Mervyn

0 Kudos