Hi everybody,
I'm getting an error when trying to segment a multispectral orthomosaic. I've drawn the polygons representing the plant and soil classes, respectively. Also, I can see the created points in the variable "training_sam" (200 for each class). But I get an error when I try to use the fieldSegment function.
soil<-fieldView(mosaic = ortho1, editor = TRUE)
soil<-st_as_sf(st_sample(soil, 200))
soil$class<-'soil'
plants<-fieldView(mosaic = ortho1, editor = TRUE)
plants<-st_as_sf(st_sample(plants, 200))
plants$class<-'plants'
training_sam<-rbind(soil,plants)
classification <- fieldSegment(mosaic = ortho1, trainDataset = training_sam)
[1] "Starting supervised classification ..."
Error in predict.randomForest(modelFit, newdata) :
variables in the training data missing in newdata
Could somebody please help me with this?