Forum

Author Topic: how to calculate orthomosaic resolution when using sparse cloud  (Read 5014 times)

jeremyeastwood

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
how to calculate orthomosaic resolution when using sparse cloud
« on: November 21, 2016, 11:41:31 PM »
Hi there,

I'm using the following to calculate the orthomosaic resolution for my map:

Code: [Select]
ortho_res = float(chunk.model.meta['model/resolution']) / int(chunk.model.meta["model/depth_downscale"]) * chunk.transform.scale
This works fine for my normal workflow, however sometimes I generate a quick orthomosaic using just the sparse point cloud, and this breaks the snippet above, as
Code: [Select]
chunk.model.meta["model/depth_downscale"] no longer exists, resulting in:
Code: [Select]
int() argument must be a string or a number, not 'NoneType'
How should I calculate my orthomosaic resolution when I have not generated a dense point cloud?

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #1 on: November 22, 2016, 03:31:40 PM »
Hello jeremyeastwood,

If there's no dense cloud generated for the chunk, to estimate the default resolution of the orthomosaic you need to average the distance between the camera centers and tie points that have valid projections on the corresponding photo.

But you can also skip using resolution (dx, dy) in the buildOrthomosaic() function if you wish orthomosaic to be generated using default resolution.
After orthomosaic is generated you can access the resolution value using chunk.orthomosaic.resolution method.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #2 on: March 11, 2019, 06:55:59 PM »
Hello ,

chunk.model.meta['model/resolution'] apparently disappeared in Metashape 1.5.x.

Would it be possible to bring back this info?

Or could you explain how to get it in python script?
By the way, is it also possible to get the estimated resolution for the DEM from mesh?

I get stuck trying by myself...

Thanks a lot,

Best regards!
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #3 on: March 11, 2019, 07:14:06 PM »
Hello Seboon,

What do you have in chunk.model.meta?

Was the model generated in the version 1.5?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #4 on: March 11, 2019, 07:35:06 PM »
Hello Alexey,
Thank you for your fast reply.

Here's the log after re-generating the mesh  inside Metashape 1.5.1 (just in case!):

Metashape.app.document.chunk.model.meta
Out[1]: 2019-03-11 17:31:29 {'model/depth_downscale': '4', 'model/duration': '776.035', 'model/mesh_face_count': '243678', 'model/mesh_object_type': '0', 'model/mesh_source_data': '6', 'model/smoothness': '5'}

I may also report I didn't generate Dense Cloud.

Any idea?

Thanks.
« Last Edit: March 11, 2019, 07:47:44 PM by Seboon »
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #5 on: March 11, 2019, 08:59:10 PM »
Just checked with generating Dense Cloud and rebuild Mesh from it.
The model resolution is then accessible through chunk.meta.
Is there a way to avoid building dense cloud just for getting this information?
Thanks!
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #6 on: March 12, 2019, 06:05:50 PM »
Hello Seboon,

Aren't you getting the "model/resolution" meta element if the mesh is generated from the Sparse Cloud?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #7 on: March 12, 2019, 06:25:22 PM »
Hello Alexey,

Just tried bulding from Sparse Cloud, indeed the model/resoltuion is available.

I remember having built before the mesh from Depth Maps ; it means no possibily to get the resolution of the mesh with this method ?

To resume, a mesh from sparse or dense cloud is needed?

I would like to perform  the same resolution estimation we get when generating orthomosaic or DEM  from  Metashape GUI, only with mesh generated from Depth Maps.

Thanks for your time,

Warm regards
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #8 on: March 14, 2019, 02:48:21 PM »
Hello Alexey,

Sorry to come back again with this matter, but did you find any solution?

Thanks in advance!
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #9 on: March 14, 2019, 09:10:51 PM »
Hello Seboon,

We'll try to see, if it would be possible to add "resolution" meta for the mesh generated from the depth maps in the upcoming update.

Alternatively, if you are working with aerial data, you can estimate the GSD basing on the average distance from the camera centers to the corresponding tie points (which projections are present on the related image) - that would be a default resolution for the orthomosaic, and for DEM just apply the depth_downscale factor used to generate the model.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #10 on: March 15, 2019, 10:05:28 AM »
Thank you Alexey,

I'll wait next release, as I'm not working with aerial data this time.

Best regards
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #11 on: April 28, 2019, 12:32:51 PM »
Hello Seboon,

We'll try to see, if it would be possible to add "resolution" meta for the mesh generated from the depth maps in the upcoming update.




Hello Alexey,

Do you plan to add this information in the  forthcoming releases?

Thanks.
S.Poudroux
Archaeologist - Topographer - Drone remote pilot

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #12 on: April 29, 2019, 01:14:35 PM »
Hello Seboon,

Please check, if in the version 1.5.2 you get desired output by calling
Code: [Select]
chunk.model.meta['BuildModel/resolution']Note that is would work only if the mesh is build in this version, otherwise the meta data would be missing.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Seboon

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Re: how to calculate orthomosaic resolution when using sparse cloud
« Reply #13 on: May 01, 2019, 11:35:31 AM »
Hello Alexey,

Works perfectly, thank you!

Best regards
S.Poudroux
Archaeologist - Topographer - Drone remote pilot