jianboqi / CSF

LiDAR point cloud ground filtering / segmentation (bare earth extraction) method based on cloth simulation
http://ramm.bnu.edu.cn/projects/CSF/
Apache License 2.0
496 stars 133 forks source link

Is is possible to get the cloth #27

Closed Jean-Romain closed 3 years ago

Jean-Romain commented 4 years ago

Hi, I'm wondering if it is possible to return the cloth i.e. return the coordinates of the nodes programmatically. There is a an option exportCloth in CSF::do_filtering but it seems to write something in file. I'd like to get a C++ object I could transform into a raster in R. I can modify the code if needed. Thanks.

yulongyu commented 4 years ago

when you dont give the params,exportCloth will equal false,you can change the code ,let it alway equal true

if (argc == 2 && strcmp(argv[1], "-c")==0)
{
    std::cout << "Export cloth enabled." << std::endl;
    csf.do_filtering(groundIndexes, offGroundIndexes, true);
}
else
{
    csf.do_filtering(groundIndexes, offGroundIndexes,false);//**change false to true**
}
Jean-Romain commented 4 years ago

@yulongyu I don't want to write the cloth in file. I want to get it in a C++ object at runtime.

yulongyu commented 4 years ago

it is a vector xyz , i dont know what is you meaning, you what use it in R language?

Jean-Romain commented 4 years ago

https://github.com/Jean-Romain/RCSF I want to return the cloth without writing a file.

yulongyu commented 4 years ago

in csf.h , std::vector particles //it saved the cloth

yulongyu commented 4 years ago

i know what you want to do ...... but i think it is not recommend to return a lot points to another language as parameter,In a nutshell, your question is how to pass complex types to another programming language