Applying transformation to e57 file

Please post any tips or advice you have in general relating to laser scanning either whilst onsite or office based.
Post Reply
ScanningSteve
I have made <0 posts
I have made <0 posts
Posts: 2
Joined: Tue Mar 26, 2024 7:12 am
Full Name: Stefan Blochberger
Company Details: University
Company Position Title: Student
Country: Austria
Linkedin Profile: No
Has thanked: 3 times

Applying transformation to e57 file

Post by ScanningSteve »

Hey all,

I have a point cloud in e57 format and am looking for a way to efficiently apply a transformation (via rotation matrix and translation). Im playing around with the pye57 package and am aware of the header section in the e57 file format. There is a node called 'pose' which potentially could be modified to apply the transformation without having to read the whole point cloud, but I cant seem to figure out away to actually modify these nodes as they seem to be read only.

Do you have any tips on that? Is there a was to modify those nodes? (in the pye57 description they talk about modifying them, but it doesnt work for me)
And what would be the syntax for that?

Thank you very much,
Stefan
User avatar
JShubin
I have made 30-40 posts
I have made 30-40 posts
Posts: 33
Joined: Sat Apr 28, 2018 4:29 am
5
Full Name: JShubin
Company Details: Kohera3D
Company Position Title: Laser Scanning Specialist
Country: USA
Has thanked: 17 times
Been thanked: 14 times
Contact:

Re: Applying transformation to e57 file

Post by JShubin »

Hi Stefan,

I'm unfamiliar with the pye57 package.

However, Kohera3D software will let you change an e57 scan's orientation and position via the property panel. Place your scan in a folder, then modify the translation values of the folder. When finished, export the scan using the right click>save point cloud function. This will create a new e57 file with those changes applied. Free 14 day no credit card trial if you want to give it a try.

https://www.kohera3d.com/kohera3d-ultimate/

Regards,
Jon
jedfrechette
V.I.P Member
V.I.P Member
Posts: 1238
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: 63 times
Been thanked: 222 times
Contact:

Re: Applying transformation to e57 file

Post by jedfrechette »

If I remember correctly pye57 doesn't support modifying header values, they're all just exposed as Properties. Fortunately, the transforms and all the other metadata are just stored as a big xml blob within the file so they are pretty easy to interact with directly, as long as you don't need to touch any of the actual data. Here is some Standard Library only Python code for extracting the xml metadata from an e57 file:

https://gist.github.com/jedfrechette/cf ... a307ece483

I haven't gotten around to writing a function to pack metadata back in to a file, but doing so should be relatively straightforward as it will essentially just reverse what's done in the `get_xml` function linked above. If you do end up writing any code to do that please share as I'm sure others will find it useful.
Jed
pfirmsto
I have made 20-30 posts
I have made 20-30 posts
Posts: 28
Joined: Wed Sep 22, 2021 11:19 am
2
Full Name: Peter Firmstone
Company Details: Zeus Project Services Pty Ltd
Company Position Title: Director
Country: Australia
Linkedin Profile: No
Has thanked: 14 times
Been thanked: 13 times

Re: Applying transformation to e57 file

Post by pfirmsto »

It is technically possible to write code that modifies the headers, provided it doesn't change the byte length, if the byte length of the field needs changing, then the entire file must be written.

I have considered writing my own registration software, based on a least squares adjusted survey style workflow, updating registration based on the results of least squares as a job progresses, for the control point cloud, this would allow regular updates, however other point clouds that are cloud to cloud registered to that control cloud, thus dependant upon it, would need to be re-registered and rewritten by the registration software after each update. The reason I haven't developed it, is it's better to get control tight first, then register the control point cloud, and then register everything else to that, but there are situations that call for multiple registrations when clients require data urgently and are prepared to accept less accurate data up front. It would be possible for cloud to cloud registration software to update registration, without re-writing all the files. Just thought I'd mention it, in case someone wants to consider implementing it ;)
ScanningSteve
I have made <0 posts
I have made <0 posts
Posts: 2
Joined: Tue Mar 26, 2024 7:12 am
Full Name: Stefan Blochberger
Company Details: University
Company Position Title: Student
Country: Austria
Linkedin Profile: No
Has thanked: 3 times

Re: Applying transformation to e57 file

Post by ScanningSteve »

jedfrechette wrote: Wed Mar 27, 2024 4:50 pm If I remember correctly pye57 doesn't support modifying header values, they're all just exposed as Properties. Fortunately, the transforms and all the other metadata are just stored as a big xml blob within the file so they are pretty easy to interact with directly, as long as you don't need to touch any of the actual data. Here is some Standard Library only Python code for extracting the xml metadata from an e57 file:

https://gist.github.com/jedfrechette/cf ... a307ece483

I haven't gotten around to writing a function to pack metadata back in to a file, but doing so should be relatively straightforward as it will essentially just reverse what's done in the `get_xml` function linked above. If you do end up writing any code to do that please share as I'm sure others will find it useful.
Thanks for the reply Jed,

I'm working on implementing this, its still in a stage where I keep corrupting my e57 files when updating the pose section in the xml part but I'll keep you updated when I've gotten a better look at it :) its a very bulky code and I hope I can clear it up the next days and share it here :)

Stefan
Post Reply

Return to “Tips & Advice”