Forum

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

Paulo

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #30 on: March 22, 2021, 09:07:57 PM »
Yes Dieter,

I redid the procedure without changeing any Z or other:

1. Add Laser scan into Chunk 1 with Add Photos from Workspace pane,
2. Run Quick Layout script to set estimated EO to Reference EO,
3. Measure distance between projected point 1 and center of target on scan and it is practically the same as previously 3.4 cm. Note that first coordinates of distance should correspond to Point 1 which they do. In your case, they are different.

The reason I changed your Z coordinates is that in ellipsoidal height, your Z values are about 30 m lower than actual elipsoidal height for hilltop  where Castle ruin is. See attached...Are you certain that the PPK Z coordinates of your cameras are correct?
« Last Edit: March 22, 2021, 09:10:13 PM by Paulo »
Best Regards,

Paul Pelletier

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #31 on: March 23, 2021, 12:48:38 AM »
What Version of Metashape you are using? Tomorrow i will try a reinstall of the Software.

My heights are German DHDN2016 heights, not ellipsod heights, they are 48 meters lower then the elipsoid heights.  But thats not the problem, really i dont understand what the problem is ?! Why is it running correct on your Side?

Thanks
Dieter

Paulo

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #32 on: March 23, 2021, 02:50:14 AM »
Dieter,

I think I found the reason we get different results on distance .... I am using a prior verson of   quicklayout script which uses a boolean variable has_laser_scans to test if we are dealing with laser scans. If we do then at the end it does a triangulatePoints which seems to be the trick as latest version of quicklayout does not do this  and I tried the latest script on same chunk and then measured the distance and got 1.21 m:
Code: [Select]
2021-03-22 17:33:36 Ruler coordinates:
2021-03-22 17:33:36 9014.835938 X  8336.277344 Y  491.450 m
2021-03-22 17:33:41 9015.798828 X  8336.902344 Y  491.819 m
2021-03-22 17:39:55 Measured length: 1.21 m

and then I did a triangulatePoints on the chunk. This updates the point cloud and actually adds a few points ( 22 327 Tie Points instead of original 21 610) and then same distance is measured as 3.4 cm as I previously obtained
Code: [Select]
chunk.triangulatePoints()
2021-03-22 17:34:12 TriangulatePoints
2021-03-22 17:34:12 Updating point cloud...
2021-03-22 17:34:12 adding 23018 points, 0 far (10 threshold), 680 inaccurate, 11 invisible, 0 weak
2021-03-22 17:34:12 coordinates applied in 0 sec
2021-03-22 17:34:12 Finished processing in 0.108 sec (exit code 1)

2021-03-22 17:40:46 Ruler coordinates:
2021-03-22 17:40:46 9014.834961 X  8336.277344 Y  491.450 m
2021-03-22 17:40:49 9014.852539 X  8336.250000 Y  491.459 m
2021-03-22 17:42:10 Measured length: 3.40 cm

So I hope Alexey can explain which version should be used. I attach my version which includes the triangulatePoints  part so that you can try on your side....

PS am using  Agisoft Metashape Professional Version: 1.7.2 build 12070 (64 bit)
« Last Edit: March 23, 2021, 02:58:03 AM by Paulo »
Best Regards,

Paul Pelletier

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #33 on: March 23, 2021, 10:07:34 AM »
Yes, that is the solution. I did NOT use this script because I also scanned inside the castle, so I don't have any tie-points with the photos.

I have now found the following solution for the moment: I take a scan that has enough tie points with photos and align it with the photos. Then I calculate an update of the project with fixed GPS coordinates AND fixed scan coordinates of this individual scan.

Then I can read in the remaining scans and all the coordinate transformations match up to the cm.

It would be nice if the developers offered a simpler solution here in the future. It is also desirable if these external scripts were built into the fixed code of Metashape, then all users would have the same software version and would prevent any irritation.

Thank you for your help, Paulo


Dieter

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #34 on: March 23, 2021, 12:48:55 PM »
Hello Dieter,

The projections of the marker placed on the laser scan also considers depth information, so the raise of the error that you are observing for the marker in the project after adding the projection on the laser scan is related to the depth difference between the laser scan data and 3D marker location based on its projections on photos.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #35 on: March 23, 2021, 01:23:48 PM »
Hi Alexey,

thank you for the explanation, but it does not explain why after triangulatePoints, same distance measured in scan from the projection of Marker 1 to center of target goes from 1.21 m to 3.4 cm!

The start point of measurement in both cases corresponds to coordinates of Marker 1. But it is the end point of measuremen (center of target on Scan) which varies greatly. So why does this happen?

So it is not very clear what does triangulatePoints do to fix this distance measurement.....

Best Regards,

Paul Pelletier

Paulo

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #36 on: March 23, 2021, 02:18:50 PM »
Hi all,

I think I found why distance is so different between Point 1 and center of target on Scan. I ran the procedure again using the latest quick layout (without triangulatePoints). And I again measure distance and get wrong value of 1.21 m. The reason is that Scan at target center has no Depth Value. If I measure a distance a little farther from target center where there is depth, I get correct distance of 3.57 cm. See attachment...

The question is now: Why after running triangulatePoints, the absense of depth does not affect the distance measurement?

More to follow, I hope...
Best Regards,

Paul Pelletier

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #37 on: March 23, 2021, 02:52:19 PM »
I don't think that's the reason.

When I import laser scans, I have to align at least one scan with markings to the photos, otherwise the systems are not correct and I get incorrect coordinates. I've tried hundreds of ways now and that's the only way. I can't say why that is either, but it is.

That is why the old script also brings the right results, because the scans are aligned with the photos there. The new script does not create a connection between the photos and the scans. And then it just doesn't work.

Although the coordinates match, there is in some way no connection between the photos and the scans.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #38 on: March 23, 2021, 04:08:18 PM »
If you match photos with laser scans and align cameras or triangulate points, then the tie points will appear which connect photo alignment and TLS.

If you align photos first and then load TLS and use the script to apply the exterior orientation information - these source will be isolated one from another. You can actually reset alignment for all your cameras, add TLS and use the script to define the camera EO based on the information from the Reference pane - you'll see that even in this case the 3D location of the marker based on the projections on photos is about 70 cm away from the 3D point defined on the spherical panorama (based on the TLS depth data).

The proposed procedure, described in the related tutorial assumes that image matching is performed and scans are aligned with each other and with the common digital photos:
https://agisoft.freshdesk.com/support/solutions/articles/31000159101-terrestrial-laser-scanning-data-processing

The script (quick_layout) can be used, if you would like to skip the image matching and alignment procedure and apply EO to the cameras or TLS data based on the coordinates and rotation angles from the Reference pane. The latest version of the script on github is not running image matching or alignment (triangulation), as it is a multipurpose script that also allows to apply the camera transformation for the not aligned images taken above the water bodies, for example, for the orthomosaic generation without any holes.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #39 on: March 23, 2021, 04:36:22 PM »
Please follow the steps from this manual (freshdesk) with my Original Project.

"In case the laser scanning locations are considered as precise and you would like to avoid image matching procedure between the TLS data and digital images, it is possible to apply the exterior orientation data from the Reference pane to the loaded laser scanning data using the following script:

https://github.com/agisoft-llc/metashape-scripts/blob/master/src/quick_layout.py

If the project contains also the common digital images to be aligned, it is recommended to align such image set first and then load the TLS data to the same chunk and run the mentioned script. Note that the digital images alignment should be referenced in the same coordinate space as laser scanning data in order to be properly processed together."


You will see, that it is NOT working. I've tried this several times, there is no chance to get this working. After you import the scandata (same coordiate System as fotos), run the script and then build mesh, you will see holes and fracments in the mesh. The coordinates are NOT matching. Paulo tried this too, there is no exact matching between the fotos and the scans.


jedfrechette

  • Full Member
  • ***
  • Posts: 106
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: Import Laserscan data -registration lost
« Reply #40 on: March 23, 2021, 05:35:11 PM »
It would be nice if the developers offered a simpler solution here in the future.

I can only second this. After experimenting with the proposed workflow and following threads like this the entire process seems a little half baked, and definitely not something I would consider production ready. I hope the developers reconsider their approach to this problem and can consult with users who regularly combine photogrammetry with laser scan data so that they can better understand our use cases.
Jed

Paulo

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #41 on: March 23, 2021, 05:55:11 PM »
Hello Dieter,

i did a test generating a dense cloud with Laser scan added to chunk and referenced with quick layout (without triangulating points). Then I triangulated points and redid a dense cloud. After exporting the 2 clouds and comparing  them in Global Mapper, I can say that there is no visible difference between the 2. And comparing same profile along vertical wall of ruin, there is same offset (few cm) between points generated from Laser depth (dark brown) and drone photos (greyish). See attachment...

AS far as I`m concerned there is no sensible difference between 2 clouds generated from 2 methods (with or without trianguatePoints). The dense cloud and hence mesh can be much tighter or better doing a combined alignment of Scan with photos (more time consuming)...

There remains still the mystery of distance measurement in scan from point 1 to center of target (nodepth)....

Hope this can contribute to better understabding,
Best Regards,

Paul Pelletier

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #42 on: March 23, 2021, 06:17:07 PM »
I am at a loss.

I downloaded the original project again and referenced the photos. Then I loaded the scan and then ran the script.

Look for the coordinates of the photos and scan, there are no deviations or almost zero.

After that I calculated the mesh and the result is shown below. There are two completely separate walls to the hole in the castle.

I'm afraid we won't follow the same steps.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #43 on: March 23, 2021, 06:40:26 PM »
Upon further digging into the project the source of the problem seems to be discovered:

to be properly applied, the laser scanner depth data requires the chunk.transform.scale be 1.0. It happens automatically, if the TLS data is included to the alignment procedure. In this project, since the TLS data is added to pre-aligned project, chunk.transform.scale is not 1 and the depth data from the scanner is not properly treated.

So the workaround for your project could be the following:
- perform Align Photos operation to all available data: digital photos + TLS data,
- reset camera alignment for TLS scans,
- run quick_layout script,
then build mesh from the depth maps.

If the digital photos are already aligned, but you have key points in the project, you can add TLS data and run Align Photos procedure with "reset current alignment" option unchecked. Then reset alignment for laser scans and use the script.

I'll check, if we could update the script, to modify the chunk.transform.martix, if there are any laser scans in the project, but it requires not only to change the matrix itself, but also to re-calculate the coordinates of all the cameras, tie points, mesh vertices and etc.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Dieter

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #44 on: March 23, 2021, 06:58:45 PM »
Well, that was just easy again ;)

 ::)