Forum

Author Topic: Mapping from regions in photos to point cloud  (Read 4831 times)

echinophoria

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Mapping from regions in photos to point cloud
« Reply #15 on: June 16, 2022, 08:10:43 PM »
Hi,
I am reviving this topic. But I am having some problem and I have read the API documentation up and down and the whole py script added here and still can figure out what I am missing.
I am doing the same thing the OP is doing. I apply the script and I get the vertices with the projection coordinates. Somehow it only works with the point_cloud but not with the dense_cloud.
Anyway the problem is when creating the shape. I create an empty shape. But from there on I get the error

Code: [Select]

shape.type = Metashape.Shape.Type.Polygon
2022-06-16 19:02:22 Traceback (most recent call last):
2022-06-16 19:02:22   File "<console>", line 1, in <module>
2022-06-16 19:02:22 AttributeError: type object 'Metashape.Shape' has no attribute 'Type'
The same happens with vertices, while Vertices it gives a read only error. has_z doesn't appear as an attribute either...What am I missing?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Mapping from regions in photos to point cloud
« Reply #16 on: June 16, 2022, 08:24:43 PM »
Hello echinophoria,

In the latest 1.8 versions there were the changes in API related to the Shape class. Some information is now available via shape.geometry, including .type and .coordinates (the latter replaces shape.vertices).

Instead of shape.has_z you should use s.geometry.is_3d (providing that shape.is_attached==False).
Best regards,
Alexey Pasumansky,
Agisoft LLC