I am not sure if the above code snippet is correct or its me that is doing something wrong.
(new to photoscan)
point_geocentric = currentChunk.projection.unproject(PhotoScan.Vector((676762.785,6123462.136,30)))
where the point above is x,y selected from imu log for thte first camera.
full code:
currentChunk = PhotoScan.app.document.activeChunk
point_geocentric = currentChunk.projection.unproject(PhotoScan.Vector((676762.785,6123462.136,30)))
point_geocentric.size = 4
point_geocentric[3] = 1
a_camera = currentChunk.cameras[0];
transform_matrix = currentChunk.transform * a_camera.transform
point_local = transform_matrix.t() * point_geocentric
point_local.size = 3
(image_x, image_y) = a_camera.project(point_local)
where image coordinates are calculated to 0,0, which seem to be wrong as i expect them to be somewhat under my camera (photo taken towatch earth from a airplane with a hole in the buttom).
Documentation writes, camera.transformation as 4x4 matrix describing photo location in the chunk coordinate system. Is this the the transformation matrix for moving a pixel point to the chunk coordinate system or a chunk coordinates to pixel coordinates?
Same question for chunk transformation, is that for geocentric coordinates to chunk or the other way?
in any case, should transform_matrix.t() be the inverse of the matrix instead or is transpose and inverse the same thing here ? (my linear alg is alittle rusty)