Forum

Author Topic: Tie point management  (Read 8269 times)

j.seinturier

  • Newbie
  • *
  • Posts: 19
    • View Profile
Tie point management
« on: March 03, 2017, 01:53:49 PM »
Hello,

I'm trying to create from scratch the chunk tie point cloud using python (i want to usemarkers as tie points instead of the one matched by photoscan). I've developped the following code:

  # Use only markers as tie points
  track_id = 1
 
 
  for marker in chunk.markers:
    print("Marker "+str(track_id)+" - key: "+str(marker.key)+", label: "+marker.label+", reference: "+str(marker.reference.location))
    point          = PhotoScan.PointCloud.Point()
    point.track_id = track_id
    point.coord    = marker.reference.location
    point.valid    = True
   
    chunk.point_cloud.points.append(point)
   
    for projection in marker.projections.items():
      camera      = projection[0]
      observation = projection[1].coord
      print("  projection - camera: "+camera.key+", projection: "+str(observation))
      chunk.point_cloud.projections.append(point)

However, this script say that i can't instanciate  PhotoScan.PointCloud.Point class with  PhotoScan.PointCloud.Point().

Can you help me please, and is there another way to produce my own tie point cloud without using photoscan match function ?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15472
    • View Profile
Re: Tie point management
« Reply #1 on: March 09, 2017, 10:46:30 AM »
Hello j.seinturier,

At the moment you cannot create matching points via Python API.

You can use bundler.out format to import the matching points to PhotoScan.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Phogi

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Tie point management
« Reply #2 on: May 18, 2017, 10:12:51 AM »
Hi Alexey,

So is it possible to get the tie point estimated location like marker.reference.location? Is there a tiepoint.location function in 1.3?

Thanks a lot.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15472
    • View Profile
Re: Tie point management
« Reply #3 on: May 18, 2017, 12:04:21 PM »
Hello Phogi,

Point from the point cloud have .coord method. It returns the coordinates in the internal coordinate system, so to convert it to the reference system you need to use the following code:

Code: [Select]
T = chunk.transform.matrix
crs = chunk.crs
point_geoc = T * point.coord
point_geoc.size = 3
point_geog = crs.project(point_geoc)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Phogi

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Tie point management
« Reply #4 on: May 19, 2017, 04:33:55 AM »
Hello Alexey,

Thank you for your quick response! However, what I did is manually created a tie point (e.g. Point 1), then how can I get the point.coord for it? It is not showing in the marker.reference.

Thanks a lot!

Cheers,

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15472
    • View Profile
Re: Tie point management
« Reply #5 on: May 19, 2017, 01:59:45 PM »
Hello Phogi,

Ah, you mean marker instances.

To access the coordinates of the marker in the internal coordinate system you need to use:
Code: [Select]
m = chunk.markers[0]
point_int = m.position
T = chunk.transform.matrix
crs = chunk.crs
point_geoc = T * point_int
point_geog = crs.project(point_geoc)
Best regards,
Alexey Pasumansky,
Agisoft LLC