Hi,
How PhotoScan calculates the total error?
I calculated the mean square of all errors, and there are differences. There is something wrong in the script?
Thanks
import PhotoScan
import os
import sys
chunk = PhotoScan.app.document.chunk
chunk.markers
#print(chunk.markers[7].label,chunk.markers[7].reference.location) #si pongo entre corchetes un num me da el marker n
listaErrores = []
for marker in chunk.markers:
source = marker.reference.location # posicion en terreno
estim = chunk.crs.project(chunk.transform.matrix.mulp(marker.position)) # posicion en modelo
error = estim - source
total = error.norm() #error punto
SumCuadrado = (total) ** 2 #cuadrado del error
listaErrores += [SumCuadrado] #lista de los errores
#print(marker.label, marker.reference.location, error.x, error.y, error.z, total, SumCuadrado)
print(listaErrores)
import math #libreria math
suma = 0
n = 0
for i in listaErrores:
suma = suma + i
n = n + 1
ErrorTotal = ((suma) / n)**0.5
print(ErrorTotal)