Connected component command line error

Any question about the main GUI application (frontend)
Post Reply
Michael123
Posts: 12
Joined: Wed Aug 26, 2020 1:51 pm

Connected component command line error

Post by Michael123 »

Hello,

In the context of a command line calculation, two point clouds (importCloudF2 and importReferenceCloud, from Agisoft Metashape) will be compared with M3C2. Subsequently, one point cloud will be filtered based on the M3C2 value. The filtered point cloud (EXPORTCLOUD_M3C2filtered1) is intended to be divided into connected components. Here are my commands:

Code: Select all

CloudCompare -SILENT \
-AUTO_SAVE OFF \
-O -GLOBAL_SHIFT ${globalShiftx} ${globalShifty} ${globalShiftz} ${importCloudF2} \
-SET_ACTIVE_SF 5 \
-FILTER_SF $confidenceCompareCloud 255 \
-O -GLOBAL_SHIFT ${globalShiftx} ${globalShifty} 0 ${importReferenceCloud} \
-CROP2D Z ${row_count} ${vertices} \
-M3C2 ${M3C2PARA} \
-POP_CLOUDS \
-C_EXPORT_FMT ASC -ADD_HEADER \
-SAVE_CLOUDS FILE ${EXPORTCLOUD1}.txt \
-SET_ACTIVE_SF 5 \
-FILTER_SF MIN -$M3C2Value \
-C_EXPORT_FMT ASC -ADD_HEADER \
-SAVE_CLOUDS FILE ${EXPORTCLOUD_M3C2filtered1} \
-EXTRACT_CC 9 98 \
-C_EXPORT_FMT ASC -ADD_HEADER \
-SAVE_CLOUDS ALL_AT_ONCE FILE ${EXPORTCLOUD_components}
I'm working here with quite a few variables, but I believe the basic procedure will become apparent.
The following error message appears, and the connected component command is not executed:
CloudCompare: /mnt/Daten/software/cloudcompare/cloudcompare-v2.12.4/libs/qCC_db/include/ccScalarField.h:66: void ccScalarField::Range::setBounds(ScalarType, ScalarType, bool): Assertion `minVal <=maxVal' failed.
/var/spool/slurmd/job62900/slurm_script: line 231: 182826 Aborted (core dumped)
When I apply "-EXTRACT_CC 9 98" via command line, the error occurs.
When I apply "-EXTRACT_CC 1 2" via command line, the operation completes, but only one component is generated as an empty text file. However, when I manually load the point cloud EXPORTCLOUD_M3C2filtered1 into CloudCompare and apply EXTRACT_CC with 9 98, I get the desired result. The strange thing is that the process works in command line mode when I let importCloudF2 generate with higher accuracy values in Metashape, even though the resulting point cloud EXPORTCLOUD_M3C2filtered1 looks similar as the one with lower accuracy settings, just with a few more points. In both cases, the point cloud to which the command is applied has the necessary minimum number of points to produce a result. So, how should the error message be interpreted?

I really hope someone can help me. I'm getting a bit desperate...

Best regards,
Michael
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Connected component command line error

Post by daniel »

Oops, it seems I missed this message. And it looks tough to understand, so it may take some time before I'm able to process it...
Daniel, CloudCompare admin
Michael123
Posts: 12
Joined: Wed Aug 26, 2020 1:51 pm

Re: Connected component command line error

Post by Michael123 »

Hi Daniel,

I was able to simplify the script to a state where I try to use LCC on two different files which result from the same postprocessing method. It works on the one file, using it on the other file shows the same error message that I already mentioned. The structure of both PC seem to be identical, the only difference is the point number. My code:

Code: Select all

echo 'setting global shift'
globalShiftx=-639000
echo 'globalShiftx:' $globalShiftx
globalShifty=-5510000
echo 'globalShifty:' $globalShifty
globalShiftz=0
echo 'globalShiftz:' $globalShiftz



pcOptimized1=MP2_DM4_KP0_TP0_grad-0.1-10-2-10_crop2d_conf5-255_M3C2-params_CorePtsPc1_D0,2_H2,5_MIN_-0.25.txt
pcOptimized2=MP2_DM2_KP0_TP0_grad-0.1-10-2-10_crop2d_conf5-255_M3C2-params_CorePtsPc1_D0,2_H2,5_MIN_-0.25.txt
OctreeLevel=9
minPointNumber=89

echo -e "\n*** run CloudCompare"

#xvfb-run \
QT_QPA_PLATFORM=offscreen \
CloudCompare -SILENT \
-AUTO_SAVE OFF \
-O -GLOBAL_SHIFT ${globalShiftx} ${globalShifty} ${globalShiftz} ${pcOptimized2} \
-EXTRACT_CC $OctreeLevel $minPointNumber \
-SF_ADD_CONST CDT 99 \
-C_EXPORT_FMT ASC -ADD_HEADER \
-SAVE_CLOUDS ALL_AT_ONCE FILE export.txt \
-REMOVE_ALL_SFS \
-MERGE_CLOUDS \
-C_EXPORT_FMT ASC -ADD_HEADER \
-SAVE_CLOUDS FILE export_merged.txt \
-CLEAR_CLOUDS  

I can send you both PC if you want to reproduce the error.

Best regards
Michael
daniel
Site Admin
Posts: 7382
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Connected component command line error

Post by daniel »

Yes, that would help a lot! Thanks.
Daniel, CloudCompare admin
Michael123
Posts: 12
Joined: Wed Aug 26, 2020 1:51 pm

Re: Connected component command line error

Post by Michael123 »

Thank you Daniel, I sent you the files.
Post Reply