Forum

Author Topic: Get cloud point in reference coordinates  (Read 1317 times)

szaman

  • Newbie
  • *
  • Posts: 2
    • View Profile
Get cloud point in reference coordinates
« on: September 18, 2020, 03:07:36 PM »
Hi,
I would like to automate processing of my scans. And I have a problem with cleaning the stand that the obiect is located at.
Here is what I do:
align cameras
create markers at certain camera positions which are known
set the reference positions of the markers  like marker4.reference.location = ([-1.0, 0.0, -1.0])
then chunk.updateTransform()

That makes my obiect perfectly rotated and aligned at center
What I would like to do now is to delete certain points from chunk.point_cloud.points which coord Y are below zero like

Code: [Select]
for i in range(len(chunk.point_cloud.points)):
    if chunk.point_cloud.points[i].coord[1]<0.0:
        chunk.point_cloud.points[i].selected=True

But that selects the points in different orientation than visible at the viewport.
My question is how to get the point cloud point position in corrected transform?(after chunk.updateTransform())

Thanks
Pawel
« Last Edit: September 18, 2020, 04:29:47 PM by Alexey Pasumansky »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Get cloud point in reference coordinates
« Reply #1 on: September 18, 2020, 04:29:56 PM »
Hello Pawel,

You should consider chunk transformation matrix for scaled and referenced chunks:

Code: [Select]
points = chunk.point_cloud.points
T = chunk.transform.matrix
for point in points:
    if (T * point.coord)[1] < 0.0:
        point.selected=True
Best regards,
Alexey Pasumansky,
Agisoft LLC