I would be so delighted if you could help fixing my problem! Thanks in advance for your nice and open communication and help with previous cases, that is amazing and pretty helpful.
I currently try to run the OBIA for Sentinel-2 VIS raster stack. Everything was fine until I reached the step about the calibration of the classifier. The output of my function "prepareCalData is not what it is supposed to be, it is just a empty value and not a data frame and especially not an object of class SOptim.CalData as the error is telling.
segmObj <- segmentation_OTB_LSMS(inputRstPath= inputRstPath.path,
outputSegmRst= outputSegmRst.path,
SpectralRange=100,
SpatialRange=20,
MinSize=30,
lsms_maxiter=10,
tilesizex = 1416,
tilesizey = 1649,
otbBinPath= otbPath,
verbose=TRUE)
rstSegm <- raster(segmObj$segm)
print(rstSegm)
plot(rstSegm)
prepareCalData(rstSegm = rstSegm, trainData = trainDataRst, rstFeatures = classificationFeatures.path, thresh = 0,
funs = c("mean","sd"), minImgSegm = 10, verbose = TRUE, progressBar = TRUE)
_________________ The output of prepare CalData______________with the error that comes for calibrate Classifier_____________
calibrateClassifier(calData,
classificationMethod = "RF",
classificationMethodParams = NULL,
balanceTrainData = FALSE,
balanceMethod = "ubOver",
evalMethod = "HOCV",
evalMetric = "Kappa",
trainPerc = 0.8,
nRounds = 20,
minTrainCases = 30,
minCasesByClassTrain = 10,
minCasesByClassTest = 10,
runFullCalibration = TRUE)
(see error message above in image)
I am not sure what the problem is. The segmentation worked and the training data seems to be okay, would appreciate if there is a solution, I really want it to work :D