Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: vass 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
-
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.
-
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
-
Hello Vass,
You should use the following construction for assigning j-marker projections on the i-photo:
chunk.markers[j].projections[chunk.photos[i]] = (x,y)
-
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