madduci / PCD-E57

Converter PointCloud Library <---> E57 file format
MIT License
35 stars 16 forks source link

E57 did not use MM as unit #6

Open dogod621 opened 5 years ago

dogod621 commented 5 years ago

E57 use meters as unit (You can check the translation value of pose data.). But cartesianX, cartesianY, cartesianZ are "ScaledIntegerNode", so you should scale the values.

for example , I got my E57 data from BLK360 scanner. scaleX, scaleY, scaleZ of following Example code is 1e-5. after multiply the scale, the final XYZ is in meters. ( And then it can match the pose translation )

Example: e57::CompressedVectorNode scanPoints(scan.get("points")); e57::StructureNode proto(scanPoints.prototype()); e57::ScaledIntegerNode protoX(proto.get("cartesianX")); e57::ScaledIntegerNode protoY(proto.get("cartesianY")); e57::ScaledIntegerNode protoZ(proto.get("cartesianZ"));

double scaleX = protoX.scale(); double scaleY = protoY.scale(); double scaleZ = protoZ.scale();

madduci commented 5 years ago

Hi,

thanks for the issue. Actually I don't deal anymore with E57 data, so I don't have any dataset to test with, to verify if also my data is in meters or not. Would you mind to submit the correction as pull request?

dogod621 commented 5 years ago

here is the free dataset: https://lasers.leica-geosystems.com/blk360-data-set-downloads your code didnot scale xyz correctly, so it will failed when combine multiple scan to a single point cloud (the pose translation did not match).

by the way, why not read rgb data from e57 ( to pcl::PointXYZRGBA )

dogod621 commented 5 years ago

https://github.com/dogod621/E57Converter

DEMO

Hi, I write a new E57 converter. I fix the issue, and further:

  1. support out-of-core (for large e57 scan data)
  2. support scaled integer XYZ
  3. support spherical coordinate
  4. support perpoint RGB, intensity, scan index
madduci commented 5 years ago

Hi @dogod621 thanks for the inputs!

As I developed it on my own time ago, I haven't used OutOfCore because I had only the possibility to test with smaller point clouds and I was using Intensity instead of RGB because my original dataset wasn't with RGB information, therefore I used the XYZI format.

Anyway thanks for the inputs, I will try to fix my code as soon as I can but I will accept happily merge requests

dogod621 commented 5 years ago

@madduci I found the correct way to read scaled integer....

https://github.com/asmaloney/libE57Format/issues/16

jean-noelp: when you build your SourceDestBuffer, ensure to activate the auto-scaling on cartesian values! vector destBuffers; double x[N]; destBuffers.push_back(SourceDestBuffer(imf, "cartesianX", x, N, true, true)); double y[N]; destBuffers.push_back(SourceDestBuffer(imf, "cartesianY", y, N, true, true)); double z[N]; destBuffers.push_back(SourceDestBuffer(imf, "cartesianZ", z, N, true, true));

madduci commented 5 years ago

Hi @dogod621 thank you very much for the hint. I'm doing (slowly) a refactoring of code supporting newer PCL and newer C++ standard