Forum

Author Topic: Update transform with import data (dense cloud)  (Read 3186 times)

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Update transform with import data (dense cloud)
« on: February 14, 2020, 08:00:47 PM »
Dear Agisoft team,

Within an automated workflow, we would need to update the transformation of a chunk, including a imported dense cloud.
However, even if the point cloud import is done before the transformation, basic stuff (images + tie points) are transformed but the dense cloud remain at the imported coordinates.

Is it possible to include all 3D datas in updateTransform() command ? Or may it exist any solution to transform the dense cloud together with the rest of the chunk ?

P.S. I know it is impossible to "optimize" a dense cloud. What I would need is only apply a basic Helmert transform on this cloud.

Regards
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: Update transform with import data (dense cloud)
« Reply #1 on: February 14, 2020, 08:24:45 PM »
Hello Yoann,

Imported dense cloud by default has its own transformation dense_cloud.transform and coordinate system dense_cloud.crs.

To disable "Lock Transform" option via Python you should complete following steps:
Code: [Select]
dense_cloud.transform = Metashape.Matrix().Diag([1,1,1,1])
dense_cloud.crs = None

In this case the dense cloud would be affected by the applied chunk.transform as other elements of the chunk.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Update transform with import data (dense cloud)
« Reply #2 on: March 09, 2020, 06:12:32 PM »
Hello Alexey,

Thanks for your reply,
After some investigations, it looks those steps don't affect dense_cloud "locked" transformation :
-> dense_cloud.transform is already a diagonal matrix
-> dense_cloud.crs is <CoordinateSystem 'Local Coordinates'>, but set to None doesn't change anything.

I was able to find a workaround by saving chunk.transform.matrix before and after updateTransform() command.
Then, I apply :
Code: [Select]
chunk.dense_cloud.transform = Metashape.Matrix().Diag([1,1,1,1]) * previous_chunk_transform_matrix * new_chunk_transform_matrix.inv()The dense cloud take the right new location, but then following treatments don't work correctly anymore (like dense_cloud classification, etc...)

Looking forwards to your help.
Regards
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Yoann Courtois

  • Sr. Member
  • ****
  • Posts: 316
  • Engineer in Geodesy, Cartography and Surveying
    • View Profile
Re: Update transform with import data (dense cloud)
« Reply #3 on: March 19, 2020, 07:04:39 PM »
May I have some help about that ?
--
Yoann COURTOIS
R&D Engineer in photogrammetric process and mobile application
Lyon, FRANCE
--

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: Update transform with import data (dense cloud)
« Reply #4 on: March 19, 2020, 07:20:20 PM »
Hello Yoann,

If the following code doesn't help, please send the project with "locked" dense cloud but which is not affected by any script commands, so that I could check it?

Code: [Select]
chunk.dense_cloud.crs = None
chunk.dense_cloud.transform = chunk.transform.matrix.inv() * chunk.dense_cloud.transform
Best regards,
Alexey Pasumansky,
Agisoft LLC