1
General / Re: Draw rectangle polygon
« on: June 28, 2019, 09:30:56 PM »
Perfect, thank you!
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.
PhotoScan.app.addMenuItem("CustomMeno/Test", main)
import PhotoScan #Photoscan 1.4.1
file1 = open(path, "wt")
chunk = PhotoScan.app.document.chunk #active chunk
cameras=chunk.cameras
for camera in cameras: # Loop through cameras
if camera.enabled is True: # Only apply to enabled cameras
estimated_coord = chunk.crs.project(chunk.transform.matrix.mulp(camera.center)) #estimated XYZ in coordinate system units
cam_vec_int = camera.transform.mulv(PhotoScan.Vector([0,0,1]))
cam_vec_ext = chunk.transform.matrix.mulv(cam_vec_int)
cam_vec_ext.normalize()
print(camera.label, estimated_coord, cam_vec_ext)
file1.write(camera.label + "," + "{:.8f}".format(estimated_coord) + "," + "{:.8f}".format(cam_vec_ext) + "\n") #writing cameras
file1.write("#\n")
file1.close()
2019-05-31 12:44:47 ExportOrthophotos: jpeg_quality = 99, path = D:/$$$$/{filename}.tif, resolution_x = 4.59399e-005, resolution_y = 4.59399e-005, tiff_compression = 1, write_alpha = off, write_world = on
2019-05-31 12:44:47 Exporting orthophotos...
2019-05-31 12:44:47 exporting 0 images
2019-05-31 12:44:47 Finished processing in 0.001 sec (exit code 1)