Closed Jean-Romain closed 6 years ago
@Jean-Romain Thank you very much for your quick reply and creating this repo. I would like to make CSF a R package. I have looked the code. I find some default parameters is not properly inlitialized.
csf.params.bSloopSmooth = SloopSmooth;
csf.params.class_threshold = 0.5;
csf.params.cloth_resolution = ClothResolution;
csf.params.interations = 500;
csf.params.rigidness = 1;
csf.params.time_step = 0.65;
If I set these parameters, this program works fine.
But what I do not understand is that I have inlitialized these parameters in constructor of CSF class,
CSF::CSF(int index) {
params.bSloopSmooth = true;
params.time_step = 0.65;
params.class_threshold = 0.5;
params.cloth_resolution = 1;
params.rigidness = 3;
params.interations = 500;
this->index = index;
}
But in R_CSF function, if the parameter is not set, they still remain uninlitialized. Do you have some idea?
Works fine now. The parameters should indeed be initialized in the constructor but they are not. I will study that later. I think that valgrind
will help.
Notice that you are a collaborator of this repo, thus you have read and write access to the code. Feel free to fix bugs, document the function, change the authoring, the license and so on.
library(lidR)
library(RCSF)
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
las = readLAS(LASfile, select = "xyz")
gnd = CSF(las@data)
las@data[, Classification := 0]
las@data[gnd, Classification := 2]
plot(las, color = "Classification")
@jianboqi using the test example:
The algorithm seems to be stucked in an infinite loop. I did not study the original article or the CSF source code but you will be able to easily figure out what is going wrong in the file
src/R_CSF.cpp
.