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?
PDAL export setup coordinates
- smacl
- 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
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.
-
- 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
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.
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
- smacl
- 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
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.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.
-
- 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
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.smacl wrote: ↑Fri Aug 20, 2021 10:23 amSounds 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.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.