repaired bounding boxes rounding problem?
PotreeConverter_2.1_x64_windows doesn't like the bounding boxes of LAZ files that have been repaired with LAStools-2021-07-20/lasinfo -repair_bb that appear to be due to rounding values...
ERROR(chunker_countsort_laszip.cpp:237): encountered point outside bounding box.
box.min: -10.192, -14.1157, -1.7038
box.max: 17.855499999999999, 13.931799999999999, 26.343699999999998
point: 7.3163, 13.931800000000001, -1.649
file: whatever.laz
PotreeConverter requires a valid bounding box to operate.
Please try to repair the bounding box, e.g. using lasinfo with the -repair_bb argument.
Same problem!
Y axis on box.max a bit smaller than point y-coordinate.
ERROR(chunker_countsort_laszip.cpp:237): encountered point outside bounding box. box.min: 546751.69976062572, 6051869.2593929153, 138.13107263576239 box.max: 546837.05885304476, 6051954.6184853343, 223.49016505479813 point: 546764.08499999996, 6051954.6200000001, 143.55500000000001 file: file.las PotreeConverter requires a valid bounding box to operate. Please try to repair the bounding box, e.g. using lasinfo with the -repair_bb argument.
Hi,
I got the same issue.
I didn't succeed to solve this using lasinfo.
I succeeded to to solve the issue by modifying the 3 lines in the source code 221 -->223 (in chunker_countsort_laszip.cpp) then recompile... :
float ux = (float(X) * posScale.x + posOffset.x - min.x) / size.x;
float uy = (float(Y) * posScale.y + posOffset.y - min.y) / size.y;
float uz = (float(Z) * posScale.z + posOffset.z - min.z) / size.z;
regards
I modified the code and is to be found here: https://github.com/ykhedar/PotreeConverter
Cheap workaround (which worked for me this one time):
Read and write the file again with pdal:
[ "infile.laz", { "type" : "writers.las", "dataformat_id": "0", "scale_x":"0.001", "scale_y":"0.001", "scale_z":"0.001", "offset_x":"auto", "offset_y":"auto", "offset_z":"auto", "filename" : "outfile.laz" } ]
Can U explain more? @tobias-brunner I cant do that
Machine precision is something that is know.
You should not used iota=0.0001 in your code.
https://en.wikipedia.org/wiki/Machine_epsilon
I would suggest more something like iota=3e-16
Can U explain more? @tobias-brunner I cant do that
pdal translate pc.las pc1.las, then pc1.las will work fine with PotreeConverter
Hello, I'm having the same issue with Potree Viewer 1.8.0 on Windows 11. Using PotreeConverter 2.0, the error message is:
ERROR(chunker_countsort_laszip.cpp:248): encountered point outside bounding box.
box.min: 416.03942899999998, -27.960518, -2.3659479999999999
box.max: 616.0061649999999, 172.0062179999999, 197.60078799999991
point: 616.00999999999999, 86, 7.7999999999999998
file: cloud.las
PotreeConverter requires a valid bounding box to operate.
Please try to repair the bounding box, e.g. using lasinfo with the -repair_bb argument.
I've tried @chaoqun-wang0721's suggestion of using pdal translate but that didn't solve the issue. Thank you.
EDIT: I was able to successfully import my point cloud by using PotreeConverter 1.7 instead of 2.0.
For me, the following patch solved the issue:
diff --git a/Converter/src/chunker_countsort_laszip.cpp b/Converter/src/chunker_countsort_laszip.cpp
index 086c00d..bc9a553 100644
--- a/Converter/src/chunker_countsort_laszip.cpp
+++ b/Converter/src/chunker_countsort_laszip.cpp
@@ -6,6 +6,7 @@
#include <mutex>
#include <memory>
#include <atomic>
+#include <cfloat>
#include "chunker_countsort_laszip.h"
@@ -234,7 +235,7 @@ namespace chunker_countsort_laszip {
double uz = (double(Z) * posScale.z + posOffset.z - min.z) / size.z;
bool inBox = ux >= 0.0 && uy >= 0.0 && uz >= 0.0;
- inBox = inBox && ux <= 1.0 && uy <= 1.0 && uz <= 1.0;
+ inBox = inBox && ux <= 1.0 + DBL_EPSILON && uy <= 1.0 + DBL_EPSILON && uz <= 1.0 + DBL_EPSILON;
if (!inBox) {
stringstream ss;
For me, the following patch solved the issue:
diff --git a/Converter/src/chunker_countsort_laszip.cpp b/Converter/src/chunker_countsort_laszip.cpp index 086c00d..bc9a553 100644 --- a/Converter/src/chunker_countsort_laszip.cpp +++ b/Converter/src/chunker_countsort_laszip.cpp @@ -6,6 +6,7 @@ #include <mutex> #include <memory> #include <atomic> +#include <cfloat> #include "chunker_countsort_laszip.h" @@ -234,7 +235,7 @@ namespace chunker_countsort_laszip { double uz = (double(Z) * posScale.z + posOffset.z - min.z) / size.z; bool inBox = ux >= 0.0 && uy >= 0.0 && uz >= 0.0; - inBox = inBox && ux <= 1.0 && uy <= 1.0 && uz <= 1.0; + inBox = inBox && ux <= 1.0 + DBL_EPSILON && uy <= 1.0 + DBL_EPSILON && uz <= 1.0 + DBL_EPSILON; if (!inBox) { stringstream ss;
Would you accept a fee for assisting in using this patch? I have Potree up and working well, but about half of our clouds throw this rounding error. I have an HTML programmer on team now, but this patch is outside his skill range. Time is critical, so please let me know and TY.
https://tlse-land-viewer.s3.amazonaws.com/Point_Cloud_Model/PotreeViewer/viewer.html
Hi @Cambraceres, please e-mail me at [email protected] to discuss this.
可以修改las文件中该点的值