Dear João Gonçalves:
I am using the TerraLib segmentation for small areas of a larger image (at the moment, using images of 892,144 pixels) without any problem. In order to optimise the segmentation process for large areas, I have converted my original floating point .tif bands to int data type using ArcMap (output are .tif rasters). Now, the segmentation_Terralib_Baatz() function does not output a segmentation.
I think that the problem is this one: this .tif format is not readable by R (whereas for ArcMap is). Is this possible? Or perhaps the function does not work with integer rasters?
Here is my code. As you can see, nothing is "unusual".
ImgSegment <- segmentation_Terralib_Baatz(
c(0.1, 5, 0.9, 100),
"D:/.../Stacked_.tif",
"D:/.../Segmented.tif",
CompactnessWeight = NULL,
SpectralWeight = NULL,
Threshold = NULL,
MinSize = NULL, # Minimum size of 8 because oour training samples have 8 pixels (Pol -> Ras)
verbose = TRUE, # I want to see messages
TerraLib.path = "C:/terralib-5.2.1-TISA-win_x64/terralib-5.2.1-TISA/lib" #route to TerraLib
)
# Check the result
rstSegm <- raster(ImgSegment$segm)
(...)
Of course, all the data is in the same extent and projection (4 spectral bands and a DEM).
Thank you.