I was worried because II thought I was doing something wrong.
Sorry, but I've other question.
I'm having a lot of problems with choise of segments parameters.
My difficulty understanding these three parameters below and it relationship with segment sizes:
# The number of clusters (k) in the KMeans.
numClusters = 10
# The minimum object size in pixels.
minObjectSize = 200
distThres = 1000000
I'm looking for not too small segments, but I can not find values of these parameters that give me this.
I do not know if I understand what each one means.
I apologize for these doubts, but I've read about it and it's not clear to me how each of these parameters individually and together determines the size and number of the segments.
#!/usr/bin/env python
# Import python modules
from rsgislib.segmentation import segutils
##################### Perform Segmentation #####################
# The input image for the segmentation
inputImage = "MA_stack.kea"
# The output segments (clumps) image
segmentClumps = "MA_segs10_200.kea"
# The output clump means image (for visualsation)
outputMeanSegments = "MA_meansegs10_200.kea"
# A temporary path for layers generated during the
# segmentation process. The directory will be created
# and deleted during processing.
tmpPath = "./tmp/"
# The number of clusters (k) in the KMeans.
numClusters = 10
# The minimum object size in pixels.
minObjectSize = 200
# The distance threshold to prevent merging.
# this has been set to an arbitrarily large
# number to disable this function.
distThres = 1000000
# RSGISLib function call to execute the segmentation
segutils.runShepherdSegmentation(inputImage, segmentClumps, outputMeanSegments,
tmpPath, "KEA", False, False, False, numClusters,
minObjectSize, distThres, None)
################################################################