marker = chunk.markers[0]photo = chunk.cameras[0]v_proj = marker.projections[photo].coord #2 dimensional vector of the marker projection on the photo v_reproj = photo.project(marker.position) #2 dimensional vector of projected 3D marker positiondiff = (v_proj - v_reproj).norm() #reprojection error for current photo
Hello ARF__,You can try the following for the active chunk (if projected coordinate system is used):Code: [Select]import PhotoScanchunk = PhotoScan.app.document.chunkfor marker in chunk.markers: source = marker.reference.location estim = chunk.crs.project(chunk.transform.matrix.mulp(marker.position)) error = estim - source total = error.norm() print(marker.label, error.x, error.y, error.z, total)
import PhotoScanchunk = PhotoScan.app.document.chunkfor marker in chunk.markers: source = marker.reference.location estim = chunk.crs.project(chunk.transform.matrix.mulp(marker.position)) error = estim - source total = error.norm() print(marker.label, error.x, error.y, error.z, total)
import mathtotal =0num = 0for camera in chunk.cameras: if not camera in marker.projections.keys(): continue v_proj = marker.projections[camera].coord #2 dimensional vector of the marker projection on the photo v_reproj = camera.project(marker.position) #2 dimensional vector of projected 3D marker position diff = (v_proj - v_reproj).norm() #reprojection error for current photo total += diff ** 2 num +=1print(math.sqrt(total / num))