diff --git a/photon-client/src/components/cameras/CameraCalibrationCard.vue b/photon-client/src/components/cameras/CameraCalibrationCard.vue index d9eca1a36..62dfb83ab 100644 --- a/photon-client/src/components/cameras/CameraCalibrationCard.vue +++ b/photon-client/src/components/cameras/CameraCalibrationCard.vue @@ -26,7 +26,9 @@ const getUniqueVideoFormatsByResolution = (): VideoFormat[] => { const calib = useCameraSettingsStore().getCalibrationCoeffs(format.resolution); if (calib !== undefined) { // For each error, square it, sum the squares, and divide by total points N - format.mean = calib.meanErrors.reduce((a, b) => a + b) / calib.meanErrors.length; + if (calib.meanErrors.length) + format.mean = calib.meanErrors.reduce((a, b) => a + b, 0) / calib.meanErrors.length; + else format.mean = NaN; format.horizontalFOV = 2 * Math.atan2(format.resolution.width / 2, calib.cameraIntrinsics.data[0]) * (180 / Math.PI); @@ -256,7 +258,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => { >