1
Python and Java API / Re: From world coordinates to pixel coordinates
« on: October 17, 2014, 04:14:06 PM »
Thank you Alexey, it works.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
import PhotoScan as ps
crs = PhotoScan.CoordinateSystem()
crs.init("EPSG::28992")
#test1
photo_0 = ps.app.document.activeChunk.photos[0]
currentChunk = PhotoScan.app.document.activeChunk
point_geocentric = currentChunk.projection.unproject(PhotoScan.Vector((74183.609,453380.738,3.388)))
(imgx, imgy) = photo_0.project(point_geocentric)
print (imgx, imgy)
#test2
a_camera = photo_0;
transform_matrix = currentChunk.transform * a_camera.transform
point_geocentric.size = 4
point_geocentric[3] = 1
point_local = transform_matrix.inv() * point_geocentric
point_local.size = 3
(image_x, image_y) = a_camera.project(point_local)
print (image_x,image_y)
print("Done")
In case of aerial photography and demand to fulfil georeferencing task, even spread of ground control
points (GCPs) (at least 10 across the area to be reconstructed) is required to achieve results of highest
quality, both in terms of the geometrical precision and georeferencing accuracy. Yet, Agisoft PhotoScan
is able to complete the reconstruction and georeferencing tasks without GCPs, too.