Forum

Poll

Is it posible to import markers for each photo (2D position) ?

create markers via python
1 (100%)
create markers via python
0 (0%)

Total Members Voted: 1

Author Topic: Import markers for photos (2D position)  (Read 9242 times)

vass

  • Newbie
  • *
  • Posts: 3
    • View Profile
Import markers for photos (2D position)
« on: November 03, 2012, 03:07:53 PM »
Hello

Is it posible to create specific marker in photo with Python? Idea is to import markers (tracked points) from tracking softvare and help Photoscan to align photos. I can not find it in Python API Reference.

Thanks

Vass

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import markers for photos (2D position)
« Reply #1 on: November 03, 2012, 03:29:01 PM »
Hello Vass,

If you have correspondence between marker label and it's projections on different photos (in pixels) such data can be imported to PhotoScan using Python.
Best regards,
Alexey Pasumansky,
Agisoft LLC

vass

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Import markers for photos (2D position)
« Reply #2 on: November 04, 2012, 03:41:52 PM »
Hello Alexey

Thanks for your advice. I am new to python scripting. So it is maybe strange question.  I find how to read 2d positions of Marker for each photo (chunk.markers[0].projections.items()).
But I can not write 2d position like this:

chunk.markers[0].projections.values()[0] = (10.0, 10.0)

even "PhotoScan.Marker().projections" is not writeable

What I am doing wrong?

Thanks for any help

Vass


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Import markers for photos (2D position)
« Reply #3 on: November 04, 2012, 04:00:05 PM »
Hello Vass,

You should use the following construction for assigning j-marker projections on the i-photo:

Code: [Select]
chunk.markers[j].projections[chunk.photos[i]] = (x,y)
Best regards,
Alexey Pasumansky,
Agisoft LLC

vass

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Import markers for photos (2D position)
« Reply #4 on: November 05, 2012, 12:05:18 PM »
Hello Alexey

Thak you very much for help. This is what i was looking for. Now I can experimenting with this. I have one more question if  I may disturb :-).
I wrote script for reading 2D projection of specific point from Pointcloud back to image (x,y). And I need to read the same point for all cameras (photos). It looks like indexing of points in pointcloud is not the same for each camera. Is it like that or I am wrong?

points = chunk.point_cloud
PhotoScan.PointCloudProjection(points,cameraIndex,pointIndex)

Thanks for your time

Vass