Forum

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

andysfd

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #15 on: January 26, 2021, 05:57:36 PM »
Thanks for the script,

Luckily i tested this prior the need for it in a project. ATM i can't test a mixed capture with photos but i will soon.
Thanks Dieter for taking the time cause i think we are trying to achieve the same.

In the end this has to work to be a serious competitor to RC regarding Meshing combined lidar / photogrammetry datasets. :)

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #16 on: February 01, 2021, 12:05:32 PM »
Hello Dieter,

Yes, it would be helpful to share the project (in the state prior to the merging operation) and brief description that we should follow to reproduce the problem on our side.

Hi Alexey,

were the problems understandable?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #17 on: February 01, 2021, 10:21:31 PM »
Hello Dieter,

I can suggest the following workflow with the help of the updated script (attached):
- process the images from the digital camera only,
- reference the processing results in the same local coordinate system used for the laser scanner (chunk 1 from your project seems to be in this state),
- add the laser scans to the same chunk (you can use Add Photos and add pre-processed TIFFs),
- run the attached script - it should apply the EO information for the laser scans, so you do not need to match photos with the laser scans),
- run Build Dense Cloud or Build Mesh operation based on the depth maps.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #18 on: February 02, 2021, 04:08:22 PM »
Hi Alexey,

the quick layout script seems to set the rotation of last laser scan in chunk to previous scan and thus false the estimeted EO of such laser scan.

In main module align_cameras, there is a call to estimate_rotation_matrices, that modifies rotation for cameras having None rotation, except last camera or laser scan as :

Quote
      for idx, c in enumerate(group_cameras[0:-1]):
         next_camera = group_cameras[idx + 1]

         if c.reference.rotation is None:
            if c.reference.location is None or next_camera.reference.location is None:
               continue

            prev_location = chunk.crs.unproject(c.reference.location)
            next_location = chunk.crs.unproject(next_camera.reference.location)

            direction = chunk.crs.localframe(prev_location).mulv(next_location - prev_location)

            yaw = math.degrees(math.atan2(direction.y, direction.x)) + 90
            if yaw < 0:
               yaw = yaw + 360

            c.reference.rotation = ps.Vector([yaw, 0, 0])

      group_cameras[-1].reference.rotation = group_cameras[-2].reference.rotation

Thus last laser scan will have estimated rotation set to previous laser scan rotation, thus falsing any subsequent data generation.

In attached screen, I ran quick layout on chunk, and you see that last laser scan has estimated yaw set to previous and thus falses its orientation as seen when a marker placed at corner of carpet is  not reprojected correctly on last laser scan.

Actually, I really do not see the use of estimate_rotation_matrices module in case of Laser Scans with precise EO.

Hope this makes sense,
« Last Edit: February 02, 2021, 09:34:24 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #19 on: February 03, 2021, 09:31:34 PM »
Hello Paul,

Thank you for pointing on the script issue.

Originally it allows to approximate the orientation for the NA cameras that do not have orientation angles input to the Reference pane. So there should be additional checks (whether reference.rotation is available) and apply this assignment only if reference.rotation is missing.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #20 on: February 04, 2021, 02:22:13 AM »
Thanks Alexey for the update,

I see that PolarNick239 updated the script to reflect this https://github.com/agisoft-llc/metashape-scripts/commit/8955104c7a72582dbf8358019ece16d96cc2d74e
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #21 on: March 21, 2021, 12:42:34 PM »
Something must go wrong with the coordinate systems, I can't get the laser scans and cameras to cover.

My project consists of 5000 drone photos with PPK coordinates. In addition, 3000 photos were taken by hand, without coordinates. I imported the drone photos and the others, had them aligned and converted to UTM32. Then I created my own coordinate system, which only contains the last 4 coordinates of the UTM coordinates. Then 25 laser scans with the same coordinates (only the last 4 digits) were imported in the same coordinate system and the coordinates were set as calculated coordinates with your script.

Everything works perfectly, control points, which were determined in the photos (not reference Points), appear in the right place in the laser scans with gray symbols. But if I now determine a point in the laser scan, the coordinates deviate by 25 cm from the target coordinates. There are some differences in the coordinate systems that I cannot explain to myself.

If I unmark all photos as a reference and then press update, the coordinates are the same, when i Import a scan, run your script, den press update, the coordinates shift by the same amount and nothing matches any longer.

Even a convert in "Local Coordinate System" make no change.

UPDATE:
I did a test with a smaller project.
1) Import photos with PPK coordinates
2) Calculation with the coordinates as control points
3) The result is correct, the error is 1 cm.
4) Conversion of the GPS coordinates to utm32
5) Reading in the scans with coordinates UTM32
6) Start your script
7) Everything seems ok, all coordinates are correct, points that were determined in the photos correspond graphically to the laser scans on the screen.
8) When I determine a point coordinate from the laser scans, the coordinates are NOT correct. When I click on update, all coordinates shift and nothing is right anymore.

How can I solve the problem?
« Last Edit: March 21, 2021, 01:42:51 PM by Dieter »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #22 on: March 21, 2021, 04:44:34 PM »
Hello Dieter,

Can you share the project with the scene that you've got on Step 4 or 5 of the procedure that you have mentioned in PSZ format? If the project with multiple scans is too large, keep only a couple of scans, if the problem can still be reproduced.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #23 on: March 22, 2021, 10:02:42 AM »
Thank you for the quick reply, here you can find the data:
https://www.dropbox.com/sh/ni0k5vmgb7f3a8v/AAAEsToauRq5LtK4tfcy4_Rha?dl=0

-Metashape Project
-Fotos as JPG-File
-Scan as Tif-File
-coordinates Fotos as TXT-File

The coordinates of the Scanner are 9014.849 8336.246 491.459 and they are correct calculated.

The Project is in status after Point 4 of my list. The coordinates has been converted to my own coordinate-System ETRS89 / UTM zone 32N Meistersehl and match to the scanner-coordinate-System.

Please import the tif-file of the Scanner and run your script, then push the update Button, all coordinates are wrong now.


Point 1 you can find in the fotos and in the scan-file.

Thanks
Dieter

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #24 on: March 22, 2021, 03:10:19 PM »
Hi Dieter,

Thanks for sharing your data set. I was able to load your laser scan tif into chunk 1 and set the EO using quick layout script. Note that estimated yaw is a little different from reference because of grid convergence.Now projection of  Point 1 in Laser Scan  falls close to target but not at center. And when I generated a dense cloud,  points from drone agree quite well with those from Scan (dark brown)... See first attachment.

I then created another chunk (Chunk 2) loading both drone images and laser scan and setting correct CRS ETRS89 / UTM32 Meistersehl + EGM2008 and did a new alignment for these 8 images. I got an estimated EO for laser scan very close to one defined  in Chunk 1. However now, there is no offset in Point 1 projection on scan and dense cloud fits perfectley. see 2nd attachment.

Please note that I shifted all Z coordinates by -15 m to better reflect actual MSL (egm2008) heights as original values (in the 490 m range ) neither corresponds to elispsoidal (520 m) or MSL (470 m).

The corresponding psz file with both chunks can be downloaded from https://drive.google.com/file/d/1bdB6amNmOf2lfJ6TmXiWQtWOGHn0tyIf/view?usp=sharing

Maybe this lead to some more insight....
« Last Edit: March 22, 2021, 04:29:21 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #25 on: March 22, 2021, 05:28:38 PM »
Paulo wrote:

"I was able to load your laser scan tif into chunk 1 and set the EO using quick layout script. Note that estimated yaw is a little different from reference because of grid convergence.Now projection of  Point 1 in Laser Scan  falls close to target but not at center."

Please move reference point 1 in the scan to the mark and watch the deviation, I have 27 pixels. This is too much.
You can also set a new point on the target mark in the scan, and then compare the coordinates with those of the target mark from the photos. The deviation is approx. 55 cm in the high value, 42 cm in the legal value and 20 cm in height.
In contrast to the photos, the scan is shifted, although this should fit.

What i've done:
-read the Original Project
-input laserscan
-run your script
-move Marker 1 to Target in the scan, this should fit with the Foto orientation!
-watch the derivation-> 27 Pixel

or:
-read the Original Project
-input laserscan
-run your script
-Set a new Marker Point 1 to the target in the Laserscan
-watch the derivation between Marker 1 (Fotos) and Point 1 (scan)
-you will see the difference


Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #26 on: March 22, 2021, 06:20:40 PM »
Dieter,

I looked at distance between projected Point 1 and center of target, I get something like 10 pixels or 3.54 cm in world distance.
After, you run the script what are the estimated  position and orientation coordinates for the laser scan?

Mine are: W11_050_0.tif    X=9012.398129685549   Y=8334.558593555354   Z=475.528094960229   Yaw=10.4121035277475   Pitch=0   Roll=-8.746525374024672e-15 or 0   

A small error in rotation components can easily bring an error of a few cm, especially for points farther fron Scan perspective center.
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #27 on: March 22, 2021, 07:03:57 PM »
Take a look at my coordinates from the ruler, i don't understand this.

Why do you changed my coordinate System?

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #28 on: March 22, 2021, 07:43:00 PM »
Dieter,

your estimated coordinates and orientation for Scan are same as mine except for Z value which I just changed by substracting 15 m to all camera centers so to have the model correspond better to real world elevation as seen in attached screen copy. With original values model was floating some 15 m in the air. So this is just a shift of -15 m in all heights with definition of CRS inluding egm2008 heights.

But this does not explain why you get a different error on Point 1 relative to target center .....?? :-\ Though are much closer to mine wrt original report of 27 pixels and 55 cm max....
« Last Edit: March 22, 2021, 08:01:39 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Dieter

  • Full Member
  • ***
  • Posts: 198
    • View Profile
Re: Import Laserscan data -registration lost
« Reply #29 on: March 22, 2021, 08:22:54 PM »
I have completely different ruler coordinates than you, that's why my big deviations.

Have you tried that in my original project? So without changing the coordinate system or recalculating.
How are your deviations there?

Thank you for your help....