0

I'm doing several segmentation tests between satellite and drone images with rsgislib. On the satellite images I had no problem but when I try the drone images the following error appears after the elimination of clumps:

Relabel clumps.
Opening clumps file: ./stack_image_clumps_elim.tif
Processing using Disk
Traceback (most recent call last):
segutils.runShepherdSegmentation(image,image_clump,img_mean,gdalformat='GTiff',numClusters=100,minPxls=50,distThres=50,sampling=100,kmMaxIter=50)
      File "/home/ubuntu/anaconda3/envs/osgeo-env-v1/lib/python3.7/site-packages/rsgislib/segmentation/segutils.py", line 191, in runShepherdSegmentation
        rsgislib.segmentation.relabelClumps(elimClumpsFile, outputClumps, gdalformat, processInMem)
    _segmentation.error: Could not create GDALDataset.

Do you think it could be a gdal problem?

The clip data of the image I'm using is this: gdalinfo -proj4 /home/ubuntu/Scrivania/Dataset/clip.tif

Driver: GTiff/GeoTIFF
Files: /home/ubuntu/Scrivania/Dataset//clip.tif /home/ubuntu/Scrivania/Dataset//clip.tif.aux.xml
Size is 709, 381
Coordinate System is:
GEOGCS["WGS 84", DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
PROJ.4 string is:
'+proj=longlat +datum=WGS84 +no_defs '
Origin = (16.099964890241999,39.047416366858158)
Pixel Size = (0.000000160878672,-0.000000160878672)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 16.0999649, 39.0474164) ( 16d 5'59.87"E, 39d 2'50.70"N)
Lower Left ( 16.0999649, 39.0473551) ( 16d 5'59.87"E, 39d 2'50.48"N)
Upper Right ( 16.1000790, 39.0474164) ( 16d 6' 0.28"E, 39d 2'50.70"N)
Lower Right ( 16.1000790, 39.0473551) ( 16d 6' 0.28"E, 39d 2'50.48"N)
Center ( 16.1000219, 39.0473857) ( 16d 6' 0.08"E, 39d 2'50.59"N)
Band 1 Block=709x1 Type=Float32, ColorInterp=Gray
Min=3.064 Max=71.527
Minimum=3.064, Maximum=71.527, Mean=17.079, StdDev=5.091
Metadata:
STATISTICS_MAXIMUM=71.52693939209
STATISTICS_MEAN=17.079104771775
STATISTICS_MINIMUM=3.0640306472778
STATISTICS_STDDEV=5.0911572606558
STATISTICS_VALID_PERCENT=100
Band 2 Block=709x1 Type=Float32, ColorInterp=Undefined
Min=3.802 Max=75.472
Minimum=3.802, Maximum=75.472, Mean=24.900, StdDev=6.595
Metadata:
STATISTICS_MAXIMUM=75.472129821777
STATISTICS_MEAN=24.900370899054
STATISTICS_MINIMUM=3.8024840354919
STATISTICS_STDDEV=6.5952746947653
STATISTICS_VALID_PERCENT=100
Band 3 Block=709x1 Type=Float32, ColorInterp=Undefined
Min=1.194 Max=78.540
Minimum=1.194, Maximum=78.540, Mean=21.044, StdDev=8.013
Metadata:
STATISTICS_MAXIMUM=78.540351867676
STATISTICS_MEAN=21.044218785929
STATISTICS_MINIMUM=1.1944425106049
STATISTICS_STDDEV=8.0133438150243
STATISTICS_VALID_PERCENT=100
Band 4 Block=709x1 Type=Float32, ColorInterp=Undefined
Min=8.460 Max=178.914
Minimum=8.460, Maximum=178.914, Mean=48.266, StdDev=16.729
Metadata:
STATISTICS_MAXIMUM=178.91448974609
STATISTICS_MEAN=48.265627691868
STATISTICS_MINIMUM=8.4597034454346
STATISTICS_STDDEV=16.728918023443
STATISTICS_VALID_PERCENT=100
Band 5 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 6 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 7 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 8 Block=709x1 Type=Float32, ColorInterp=Undefined

How can I solve the problem?

1 Answer 1

2

The output image format must support raster attribute tables in order to produce the segmentation. As far as I'm aware, the GeoTiff image format does not support raster attribute tables. Therefore you should change the gdalformat (output format) to "KEA".

The Erdas Imagine ("HFA") raster format also supports raster attribute tables, however they are not compressed by default and there is a 2GB file size limit. I'd recommend using the KEA format, since its built on top of HDF-5 which means that the raster attribute table can be read more efficiently by exploiting chunked storage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.