Forum

Author Topic: Import Laserscan data -registration lost  (Read 26297 times)

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #45 on: March 23, 2021, 07:05:18 PM »
Dieter,

I am really confused here! I did the same as you, import scan, run quick layout (without triangulating) and generated a mesh with medium quality. I do not get gap in wall going down in hole. Scratch my head  :o..

Post Script: reading Alexey`s post, now I understand why I get good  results compared to you, Dieter. My edited quick_layout script just commented out the chunk.triangulatePoints() line but still has a section where it checks if sensor has depth. If True then it calls normalize_chunk_scale which sets transform scale to 1 as pointed out by Alexey.

Eureka! with determination we have moved the learning clock along!

Thanks all for your patience.
« Last Edit: March 24, 2021, 01:16:02 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #46 on: March 24, 2021, 01:28:30 PM »
Hi Alexey,

me again, trying to get a better understanding of different parts of this issue and enjoying it! So I ran again  my edited quick layout on project (just with triangulatePoints line commented out). And as you said the normalize chunk scale fixes the scale for Laser Scan Depth but shifts the whole point_cloud (see left side of attachment with Marker 1 shifted from wall). But after running triangulatePoints(), it does reset the point_cloud to its correct position (see right side).

So a quick layout including normalize_chunk_scale and chunk.triangulatePoints()  does not affect the point_cloud and thus no need to recalculate the coordinates of tie points...

Am I right in this ?
Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #47 on: March 25, 2021, 06:45:05 PM »
Hello Paulo,

Please check, if the attached version of quick-layout script works in any case.

It includes the normalization of tie point coordinates and bounding box location.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #48 on: March 25, 2021, 11:25:49 PM »
Hi Alexey,

Thanks for this update. I see that this script does now scale the point cloud within normalize_chunk_scale without having to use triangulatePoints as in my modified script. And it does normaize the Bounding Box but the modified script did a chunk resetRegion after triangulation which is equivalent. So result is the same for both scripts. Any advantage, in using  one or the other?

Also, please note that this script in estimate_rotation_matrices sets the reference orientation of last camera to previous. So this falses the orientation of the loaded Laser Scan. See screen copy.

This problem was fixed for quick layout in github https://github.com/agisoft-llc/metashape-scripts/commit/8955104c7a72582dbf8358019ece16d96cc2d74e by changing:
Code: [Select]
group_cameras[-1].reference.rotation = group_cameras[-2].reference.rotation
with:
Code: [Select]
if group_cameras[-1].reference.rotation is None and group_cameras[-1].reference.location is not None:
group_cameras[-1].reference.rotation = group_cameras[-2].reference.rotation
« Last Edit: March 26, 2021, 03:03:11 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #49 on: March 28, 2021, 05:20:31 PM »
I've lost track of the scripts a little now.

Is there now a final script to download in which the error Paulo mentioned in the last post does not appear?

Dieter

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #50 on: March 28, 2021, 05:30:55 PM »
I've lost track of the scripts a little now.

Is there now a final script to download in which the error Paulo mentioned in the last post does not appear?

Dieter
Dieter,
as far as i am concerned the following script quick_layout_normalize_tls modified to correct the last camera rotation error does the same as quick_layout script I already posted and reposting here.
One uses scaling of point cloud to correct for original chunk scale not being 1 and the other triangulatePoints to fix same issue.

So you could use any of the 2 with same result, I think. Maybe, Alexey can confirm.

« Last Edit: March 28, 2021, 06:56:21 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #51 on: April 06, 2021, 06:41:05 PM »

Unfortunately I have to find out that none of the scripts work properly. I have now tested "quick_layout_normalize_tls.py" from Alexey and the two scripts from Paulo. In doing so, I have already read coordinate-oriented scans into an existing project with photos. Then I tried all the scripts with the following result:

The rotation of the scans is incorrect. If I tap existing points from the photos in the scans, I have deviations of several meters.

The problem must be manageable somehow.

Unfortunately, I don't have enough matches between scans and photos to really align the scans with them.

I urgently ask for help here, otherwise my project will be invalid and I will have to go to the field service again to complete the scans.

Of course I want to prevent that.

Dieter

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #52 on: April 06, 2021, 08:07:44 PM »
Hello Dieter,

this is confusing. For the latest TLS you have tested could you confirm that for imported TLS in MS then that its camera.sensor.mata has 'has_depth' attribute equal to True and camera.sensor.antenna.rotation is ((90,0,-90)) as in following screen capture.

Or better share the tif of latest TLS....
« Last Edit: April 06, 2021, 08:13:09 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #53 on: April 07, 2021, 09:47:53 AM »
Hello Paul,

how can I see your displayed values ​​on the screen? What do I have to enter / set?


I have now found out the following:

Project 1: Georeferencing was done via GCP. The scans match the coordinates.

Project 2:
Georeferencing was carried out using drone flights and GPS. The scans match the coordinates.

Merge project 1 and 2. The images and coordinates match, all control points from GCP and image coordinates match. The scans do NOT match the coordinates and are twisted.

Dieter

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #54 on: April 07, 2021, 10:55:43 AM »
Hi Dieter,

you could run the attached script in each project to print out for each TLS:

- its name;
- X Y Z Yaw Pitch Roll from E57 pose;
- sensor metadata (has depth and has intensity attributes);
- sensor antenna rotation(should be 90.000 0.000 -90.000)

See example capture screen

I would recommend that for each project, once you import the TLSs, only run one of the scripts I sent u, not the one Alexey provided as this has a bug that falses the orientation of last TLS...
« Last Edit: April 07, 2021, 11:08:36 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #55 on: April 07, 2021, 10:57:47 AM »
I found my mistake  >:(

In one of the projects, the reference settings were set instead of Yaw, Nick, Roll -> Alpha, Nu, Kappa before merging.

I have no idea how that got there.

What the heck, thank you very much for your help, now it seems to be working.

Dieter

Stef

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #56 on: October 17, 2021, 02:22:04 PM »
Just want to say thank you for all these testing, I am actually trying to fit a registered laser scan cloud inside Metashape, but all this seems to go a little too far. I've been reading through all the posts, I've been lost a couple times, and my conclusion is: Metashape is treating laser scans as photogrammetry and that's not good at all, since it's a whole different thing based on direct measurements and not triangulations.

For the times to come, until Metashape is ready (because I'm sure it will be), I'll keep doing the way I do it right now: E57 file from Drone and E57 file from Scanner, both in CloudCompare for the alignment.

Thank you to Dieter and Paulo for the in-depth tests and to Alexey for the support.

bassistas

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #57 on: January 04, 2022, 08:40:32 AM »
Hi guys, I have 39 registered scans exported from Faro scene in e57 format , 2300 photos from a phantom 4 pro and about 5600 photos from a handheld camera. I want to combine all these together and use the laser scans as a reference for the scale. The final outcome will be a textured 3D mesh and some orthophotos for architectural drawings in Autocad. So what is the best approach for this task? Do I import first the laser scans in one chunk and then I apply one of the scripts uploaded here? Then I create a second chunk with all the photos, align them and then merge two chunks for the creation of the final model?
Can anyone write the steps in summary? I'm a bit lost and the deadline is approaching  :-[
thanks

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #58 on: January 04, 2022, 02:17:25 PM »
I assume that you have no orientation for the photos?

Then I would import the laser scans, then run the script for orientation over them in order to define the laser scans as fixed points. Then import the photos and allign them with the laser scans. With a little (a lot of) luck you will have identical points between laser scans and photos. You then have to decide whether that is accurate enough and sufficient. If that doesn't work, you only have the option of looking for identical points in the laser scans and in the photos and using them as GCP for photo matching.

Good luck with it.
Dieter

bassistas

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #59 on: January 04, 2022, 11:05:51 PM »
I assume that you have no orientation for the photos?

Then I would import the laser scans, then run the script for orientation over them in order to define the laser scans as fixed points. Then import the photos and allign them with the laser scans. With a little (a lot of) luck you will have identical points between laser scans and photos. You then have to decide whether that is accurate enough and sufficient. If that doesn't work, you only have the option of looking for identical points in the laser scans and in the photos and using them as GCP for photo matching.

Good luck with it.
Dieter

I just tried that, Imported the laser scans, I run the script and it shows the scans as aligned. Then I import the photos and I try to run the alignment again with the reset current alignment option unticked but I get this error in console: 

Matching photos...
Warning: Can't resume matching without keypoints