Normalizing data in segmentation process

38 views
Skip to first unread message

Carlos Leandro Cordeiro

unread,
Feb 15, 2017, 5:58:58 AM2/15/17
to RSGISLib Support
Hi everyone, 
I'm working with segmentation using images from different sources (optical and radar), where there are variation of magnitudes between images. 
When applying the RSGISlib targeting script are the data normalized? 
In Clewley et al., 2014 says yes, but by looking at the script I did not identify this part. 
I have a doubt if I should carry out normalization as a previous segmentation step or in the segmentation process it already normalizes the data.
Thanks

Daniel Clewley

unread,
Feb 16, 2017, 3:21:33 AM2/16/17
to Carlos Leandro Cordeiro, RSGISLib Support
Hi Carlos,

Are you using runShepherdSegmentation ( http://rsgislib.org/rsgislib_segmentation.html#rsgislib.segmentation.segutils.runShepherdSegmentation) to run the segmentation? This will normalise the data by default. You can turn off using noStretch=True.

Thanks,

Dan

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

Carlos Leandro Cordeiro

unread,
Feb 16, 2017, 6:30:49 AM2/16/17
to RSGISLib Support
Hi Dan, thank you so much. 
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.


Thanks

Follow the script

#########################
#!/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)
################################################################
Reply all
Reply to author
Forward
0 new messages