Page 1 of 1

Segmention of point cloud with 3d Clipping box, command line

Posted: Thu Jan 24, 2019 2:41 pm
by Ingsayyad
I want to segment point cloud by using 3d clipping boxes and save the results in folders by using the command line.
I have text data (CSV) with
Clipping box id, xs, ys, zs, xe, ye, ze, width, height, thickness

or I can provide coordinates at each corner of the box.

Code: Select all

  -------Width---------
                /                               /|
              /                               /  |
               ---------------------End x,y,z
               |                       |         |
               |                       |         |
               |                       Height |
               |                       |
               |                       |      Thickness  
 start x,y,z---------------------    /
Is there any solution?

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Fri Jan 25, 2019 8:55 am
by daniel
See the -CROP option of the command line: http://www.cloudcompare.org/doc/wiki/in ... _line_mode

And you also have the more evolved -CROSS_SECTION option (if you want to extract multiple sections / boxes at a time)

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Fri Jan 25, 2019 12:15 pm
by Ingsayyad
I am trying

Code: Select all

"C:\Program Files\CloudCompare\CloudCompare" -AUTO_SAVE OFF ^
-o "H:\CloudComparetest\Wand.e57" ^
-CROP {379:242:106:381:244:242} ^
-C_EXPORT_FMT E57 -SAVE_CLOUDS 
I also tried

-CROP {379:242:106:2:2:1} ^// assuming width of box (2,2,1)

but getting error

Invalid parameter: box extents (component #1 is not a valid number)

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Fri Jan 25, 2019 12:48 pm
by daniel
Remove the { and } characters

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Mon Jan 28, 2019 4:54 pm
by Ingsayyad
Thank you for your reply. It works fine, but it is difficult to implement this for the segmentation of 100 elements from a point cloud of 4gb+. So, I am trying to implement the cross-section option. But I don't know how to implement it with XML.

e.g. Xsection.xml

e.g., area1 xmin,ymin,zmin 10,10,0
area1 xmax,ymax,zmax20,11,2 // file name to be saved room31


e.g., area2 xmin,ymin,zmin 20,20,2
area1 xmax,ymax,zmax 30,21,4// file name to be saved room33


e.g., area3 xmin,ymin,zmin 40,20,2
area1 xmax,ymax,zmax 42,24,4// file name to be saved room34

Can you please guide me. How the command looks like

Code: Select all

"C:\Program Files\CloudCompare\CloudCompare"  -o "H:\CloudComparetest\faroHaus.e57" -CROSS_SECTION Xsection.xml -C_EXPORT_FMT E57 -SAVE_CLOUDS 
I tried to get the idea from it but don't know how to do for my task.

http://www.cloudcompare.org/doc/cross_s ... params.xml

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Tue Jan 29, 2019 8:56 am
by Ingsayyad
I am trying this

Code: Select all

"C:\Program Files\CloudCompare\CloudCompare" -AUTO_SAVE OFF -o "H:\CloudComparetest\MHAUS.e57" ^
-CROP -3.3087:-2.6080:-1.3729:-3.2041:-0.8512:0.7371 -C_EXPORT_FMT E57 -SAVE_CLOUDS FILE "Croped_1" ^
-o "HAUS.e57" ^  // DONOT KNOW HOW TO SELECT IT FOR FURTHER SEGMENTATION
-CROP -2.001217842102:0.158620119095:-1.146977663040:1.790810465813:1.038823127747:0.860960900784 ^
-C_EXPORT_FMT E57 -SAVE_CLOUDS FILE "CROPED_2"

HAUS IS CLOUD NAME WHICH REMAINS AFTER SEGMENTING CROPED_1, I WANT TO ACTIVE THIS AND FURTHER SEGMENTATION TO AVOID LOADING CLOUD AGAIN AND AGAIN: IS THERE ANY OPTION.

Image

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Tue Jan 29, 2019 9:23 pm
by daniel
To reply to your 2 last messages:
- the cross section tool (with the XML file) can be used to segment the cloud with a clipping box automatically shifted in one or more directions, and with a potential gap between each 'cut' if necessary. You cannot use it for listing all the clipping box positions (some optimizations wouldn't work with a random list of boxes)

- I bet if you need to stick to the 'CROP' tool, you should actually make a script with a 'for' loop that will call CloudCompare with different boxes, saving the result to a specific file, and then call CloudCompare again on this new file. Python would be a good option for that's probably not the only solution.

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Wed Jan 30, 2019 8:59 am
by Ingsayyad
I have in fact more than 500 clipping boxes for a project of more than 20gb data. I will divide it into 5-6 sub-projects. I don't want to read point cloud 500 times to crop 500 elements. I want to open once the cloud and crop it with 500 clipping boxes. In other words, I don't want to write

Code: Select all

 -o "H:\CloudComparetest\MHAUS.e57" ^

500 times. It is a big cloud and takes some time to be called 500 times.

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Wed Jan 30, 2019 8:35 pm
by Buczer
@Ingsayyad
Do you solved this issue in some way ?
I have the same problem too... I have many large point cloud datasets and about 70 small AOI polygons per dataset, CC is very efficiency tool but reloading of cloud for each polygon is terrible and not efficient.

Re: Segmention of point cloud with 3d Clipping box, command line

Posted: Thu Jan 31, 2019 12:54 pm
by Ingsayyad
I have many large point cloud datasets and about 70 small AOI polygons per dataset, CC is a very effective tool but reloading of the cloud for each polygon is terrible and not efficient.
No....and this is exactly I am trying to explain to Daniel.