Error 999999 running segment mean shift

391
4
07-28-2021 05:58 AM
DBuback
New Contributor

Hello,

I am trying to classify an area using NAIP imagery, but encounter a 999999 whenever I attempt to do so. I've used the extract bands raster function to extract the 3 bands I want to use, and the raster is an 8-bit unsigned raster. Segmenting using the raster function works flawlessly, but fails whenever I try the gp tool or going through python. The code I'm using came directly from Esri's site (Segment Mean Shift—Help | ArcGIS for Desktop) and a screenshot is attached. I also attached a screenshot of the raster's properties. If anyone can help me out that would be greatly appreciated. Let me know if there's any other information needed.

segerror.JPG

rasterinfo.JPG

0 Kudos
4 Replies
JayantaPoddar
MVP Esteemed Contributor

Could you change the following line of the code?

 

seg_raster = arcpy.sa.SegmentMeanShift(inRaster, 14.5, 10, 20, "1 2 3", -1)

 

Note: I have used Spectral Detail, Spatial Detail and Min Segment Size as Numeric (Not Text). Also Max Segment Size is -1 (Default).



Think Location
0 Kudos
DBuback
New Contributor

Thank you for the response! Unfortunately that didn't solve my issue, I encountered the same error as the screenshot above.

0 Kudos
RichardDaniels
Regular Contributor

in your code example you are passing 

14.5, 10, 20

 as strings...  try defining them as numbers. Also, in the error message it is specifically looking for Max Segment Size.

0 Kudos
DBuback
New Contributor

segerror.JPG

Thank you for the suggestion. I changed them to numbers and included a max segment size. Still getting the same error message as before.

0 Kudos