PDAL export setup coordinates

Please post all open source software related items here, eg OpenScanTools
Post Reply
User avatar
MarkJLane
V.I.P Member
V.I.P Member
Posts: 149
Joined: Sat Mar 17, 2018 11:25 pm
6
Full Name: Mark Lane
Company Details: Faro Technologies
Company Position Title: ANZ Account Manager
Country: Australia
Linkedin Profile: Yes
Has thanked: 25 times
Been thanked: 43 times
Contact:

PDAL export setup coordinates

Post by MarkJLane »

I use PDAL heavily in my post-processing pipeline, but I'd like to extract the coordinates of each scan to a TXT file also.
Is this possible with PDAL or should I delve into libE57?
Mark Lane
Sydney, Australia
TLS Tools
GeoSLAM
Image
User avatar
smacl
Global Moderator
Global Moderator
Posts: 1409
Joined: Tue Jan 25, 2011 5:12 pm
13
Full Name: Shane MacLaughlin
Company Details: Atlas Computers Ltd
Company Position Title: Managing Director
Country: Ireland
Linkedin Profile: Yes
Location: Ireland
Has thanked: 627 times
Been thanked: 657 times
Contact:

Re: PDAL export setup coordinates

Post by smacl »

Mrk wrote: Thu Aug 19, 2021 4:27 am I use PDAL heavily in my post-processing pipeline, but I'd like to extract the coordinates of each scan to a TXT file also.
Is this possible with PDAL or should I delve into libE57?
I haven't used PDAL so can't comment on that, but have worked on extracting setup info from libE57. This demands some proficiency in C++ and a little bit of slightly unusual math as orientations are stored in quaternions rather than the more normal transformation matrix or set of angles. All very doable but not exactly trivial either.
Shane MacLaughlin
Atlas Computers Ltd
www.atlascomputers.ie

SCC Point Cloud module
jedfrechette
V.I.P Member
V.I.P Member
Posts: 1236
Joined: Mon Jan 04, 2010 7:51 pm
14
Full Name: Jed Frechette
Company Details: Lidar Guys
Company Position Title: CEO and Lidar Supervisor
Country: USA
Linkedin Profile: Yes
Location: Albuquerque, NM
Has thanked: 62 times
Been thanked: 219 times
Contact:

Re: PDAL export setup coordinates

Post by jedfrechette »

I don't think there is an easy way to get that info directly with PDAL, but with a little programming (not necessarily C++) it is pretty easy to extract yourself even without using libe57 or any other libraries.

In e57 files all the metadata, including scan positions, is essentially just an xml file appended to the end of the data file. It's plain text so you don't even need any special tools to inspect it.

We've done the same thing you're looking for with a small amount of Python code. In our case, that code runs within the Python interpreter of a larger application so it was easier to implement a metadata reader from scratch than to add an external library dependency. Our code is mostly standard library Python, maybe with some Scipy thrown in to handle transforms. I'm happy to share snippets to get you started if you want to go that route.
Jed
User avatar
smacl
Global Moderator
Global Moderator
Posts: 1409
Joined: Tue Jan 25, 2011 5:12 pm
13
Full Name: Shane MacLaughlin
Company Details: Atlas Computers Ltd
Company Position Title: Managing Director
Country: Ireland
Linkedin Profile: Yes
Location: Ireland
Has thanked: 627 times
Been thanked: 657 times
Contact:

Re: PDAL export setup coordinates

Post by smacl »

jedfrechette wrote: Thu Aug 19, 2021 3:30 pm I don't think there is an easy way to get that info directly with PDAL, but with a little programming (not necessarily C++) it is pretty easy to extract yourself even without using libe57 or any other libraries.

In e57 files all the metadata, including scan positions, is essentially just an xml file appended to the end of the data file. It's plain text so you don't even need any special tools to inspect it.

We've done the same thing you're looking for with a small amount of Python code. In our case, that code runs within the Python interpreter of a larger application so it was easier to implement a metadata reader from scratch than to add an external library dependency. Our code is mostly standard library Python, maybe with some Scipy thrown in to handle transforms. I'm happy to share snippets to get you started if you want to go that route.
Sounds like a good route if you're just concerned with the metadata. If you need to apply the setup information to get a unified set of points, where each point can be linked back to a setup (e.g. to translate an E57 file to a PTX file), libe57 and some C++ may be a little bit difficult to avoid.
Shane MacLaughlin
Atlas Computers Ltd
www.atlascomputers.ie

SCC Point Cloud module
badam
V.I.P Member
V.I.P Member
Posts: 916
Joined: Tue May 11, 2021 5:36 pm
2
Full Name: Adam Berta
Company Details: InnoScan 3D Hungary Kft
Company Position Title: unknown
Country: Hungary
Linkedin Profile: No
Has thanked: 51 times
Been thanked: 297 times
Contact:

Re: PDAL export setup coordinates

Post by badam »

smacl wrote: Fri Aug 20, 2021 10:23 am
jedfrechette wrote: Thu Aug 19, 2021 3:30 pm I don't think there is an easy way to get that info directly with PDAL, but with a little programming (not necessarily C++) it is pretty easy to extract yourself even without using libe57 or any other libraries.

In e57 files all the metadata, including scan positions, is essentially just an xml file appended to the end of the data file. It's plain text so you don't even need any special tools to inspect it.

We've done the same thing you're looking for with a small amount of Python code. In our case, that code runs within the Python interpreter of a larger application so it was easier to implement a metadata reader from scratch than to add an external library dependency. Our code is mostly standard library Python, maybe with some Scipy thrown in to handle transforms. I'm happy to share snippets to get you started if you want to go that route.
Sounds like a good route if you're just concerned with the metadata. If you need to apply the setup information to get a unified set of points, where each point can be linked back to a setup (e.g. to translate an E57 file to a PTX file), libe57 and some C++ may be a little bit difficult to avoid.
I've used libe57 with minimal knowledge of c++. I've created a command line app which extracts the 2D images (6 cubeface) from cyclone register/register360 exported structured e57s and their position, quaternion and then i used them in potree. There are small application examples on the libe57 webpage. The worst thing for a beginner like me is the casting of the variables. And the pointers. Especially if you come from a script languages like python, shell, etc.
Post Reply

Return to “Open Source Software”