Hello Daniele,

Please check the following script, which should export Sigma values:

`import Metashape, math`

def rotation_dx(alpha):

sina = math.sin(alpha)

cosa = math.cos(alpha)

return Metashape.Matrix([[0, 0, 0], [0, -sina, -cosa], [0, cosa, -sina]])

def rotation_dy(alpha):

sina = math.sin(alpha)

cosa = math.cos(alpha)

return Metashape.Matrix([[-sina, 0, cosa], [0, 0, 0], [-cosa, 0, -sina]])

def rotation_dz(alpha):

sina = math.sin(alpha)

cosa = math.cos(alpha)

return Metashape.Matrix([[-sina, -cosa, 0], [cosa, -sina, 0], [0, 0, 0]])

chunk = Metashape.app.document.chunk

path = Metashape.app.getSaveFileName("Specify the export file path:", filter = "Text file (*.txt);;All formats (*.*)")

file = open(path, "wt")

file.write("#Cameras\n")

file.write("#Label\tX\tY\tZ\tYaw\tPitch\tRoll\tSigmaX\tSigmaY\tSigmaZ\tSigmaYaw\tSigmaPitch\tSigmaRoll\n")

for camera in chunk.cameras:

if not camera.transform:

continue

T = chunk.transform.matrix

if chunk.transform.translation and chunk.transform.rotation and chunk.transform.scale:

T = chunk.crs.localframe(T.mulp(camera.center)) * T

R = T.rotation() * T.scale()

transform = T * camera.transform

coord = chunk.crs.project(chunk.transform.matrix.mulp(camera.center))

ypr = Metashape.Utils.mat2ypr(transform.rotation() * Metashape.Matrix.Diag((1, -1, -1)))

opk = Metashape.Utils.mat2opk(transform.rotation() * Metashape.Matrix.Diag((1, -1, -1)))

covO = camera.location_covariance

covR = camera.rotation_covariance

if not covO or not covR:

continue

covO = R * covO * R.t()

R0 = transform.rotation()

Rz = Metashape.Utils.ypr2mat(Metashape.Vector([ypr[0], 0, 0]))

Rx = Metashape.Utils.ypr2mat(Metashape.Vector([0, ypr[1], 0]))

Ry = Metashape.Utils.ypr2mat(Metashape.Vector([0, 0, ypr[2]]))

J1 = Metashape.Matrix([

list((-1) * rotation_dz(- ypr[0] * math.pi / 180) * Rx * Ry),

list(Rz * rotation_dx(ypr[1] * math.pi / 180) * Ry),

list(Rz * Rx * rotation_dy(ypr[2] * math.pi / 180))])

J2 = Metashape.Matrix([

list(R0 * rotation_dx(0) * Metashape.Matrix.Diag((1, -1, -1))),

list(R0 * rotation_dy(0) * Metashape.Matrix.Diag((1, -1, -1))),

list(R0 * rotation_dz(0) * Metashape.Matrix.Diag((1, -1, -1)))

])

J = (J2 * J2.t()).inv() * (J2 * J1.t())

J = J * (180 / math.pi)

covR = J * covR * J.t()

file.write(camera.label)

file.write("\t{:.6f}\t{:.6f}\t{:.6f}".format(coord[0], coord[1], coord[2]))

file.write("\t{:.6f}\t{:.6f}\t{:.6f}".format(ypr[0], ypr[1], ypr[2]))

file.write("\t{:.6e}\t{:.6e}\t{:.6e}".format(math.sqrt(covO[0, 0]), math.sqrt(covO[1, 1]), math.sqrt(covO[2, 2])))

file.write("\t{:.6e}\t{:.6e}\t{:.6e}".format(math.sqrt(covR[1, 1]), math.sqrt(covR[2, 2]), math.sqrt(covR[0, 0])))

file.write("\n")

file.write("#Markers\n")

file.write("#Label\tX\tY\tZ\tSigmaX\tSigmaY\tSigmaZ\n")

for marker in chunk.markers:

if not marker.position:

continue

T = chunk.transform.matrix

if chunk.transform.translation and chunk.transform.rotation and chunk.transform.scale:

T = chunk.crs.localframe(T.mulp(marker.position)) * T

R = T.rotation() * T.scale()

coord = chunk.crs.project(chunk.transform.matrix.mulp(marker.position))

covO = marker.position_covariance

if not covO:

continue

covO = R * covO * R.t()

file.write(marker.label)

file.write("\t{:.6f}\t{:.6f}\t{:.6f}".format(coord[0], coord[1], coord[2]))

file.write("\t{:.6e}\t{:.6e}\t{:.6e}".format(math.sqrt(covO[0, 0]), math.sqrt(covO[1, 1]), math.sqrt(covO[2, 2])))

file.write("\n")

print("Script finished.")

file.close()