Forum

Author Topic: Transform Matrix is Translating Chunk to Incorrect Location  (Read 2684 times)

rena

  • Newbie
  • *
  • Posts: 1
    • View Profile
Transform Matrix is Translating Chunk to Incorrect Location
« on: October 31, 2023, 07:40:25 PM »
I am having trouble applying a transformation matrix found in Riscan (and CloudCompare) to a chunk/point cloud in metashape pro. I have been following the procedure found in this thread (https://www.agisoft.com/forum/index.php?topic=4878.0), but instead of aligning my chunk to the matrix found in Riscan, it is repositioning my chunk directly north from California to Canada or Alaska.

The images I am using can only be loaded into a chunk as WGS84. After creating the dense point cloud, I export it as WGS84 UTM Z10N and load into Riscan. I then align it to my reference point cloud in Riscan (which is also in WGS84 UTM Z10N) and find the new transformation matrix. I then reproject the chunk I was working with in Agisoft also to WGS84 UTM Z10N and load in the new transformation matrix using the following procedure:

chunk = Metashape.app.document.chunk

new = Metashape.Matrix([[0.9754219240000000, -0.0210579260000000, 0.2193368030000000, -2839.9175949430000000],
[-0.0205870080000000, 0.9823592240000000, 0.1858669700000000, -2555.2639080050000000],
[-0.2193815040000000, -0.1858142060000000, 0.9577812050000000, 377.2628393970000000],
[0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 1.0000000000000000]])

chunk.transform.matrix = new * chunk.transform.matrix

This results in my chunk being translated to the north, but appears to have none of the rotation applied. The example matrix above is one that I have actually used resulting from ICP alignment in Riscan and CloudCompare. The translation numbers appear to be large, but my resulting chunk makes a pretty oblique point cloud, so there is quite a bit of rotating and translating occurring to get it in the right location. The oblique-ness is a result from other unrelated issues with the images.   

Am I applying the matrix wrong? Or is this a result of exporting my cloud and changing my chunk to a different coordinate system? Any ideas resolving this issue would be greatly appreciated!!

jedfrechette

  • Full Member
  • ***
  • Posts: 134
  • Lidar Guys
    • View Profile
    • www.lidarguys.com
Re: Transform Matrix is Translating Chunk to Incorrect Location
« Reply #1 on: November 01, 2023, 02:00:26 AM »
I'm not sure if this is the issue, but personally I would:
  • Import into WGS84 Lat/Long chunk
  • Transform chunk to UTM
  • Export dense cloud
  • Do external alignment
  • Import transform from external alignment

That way you're only doing the transform from Lat/Long to UTM once and there is less room for things to go wrong.
Jed