{{ value.resolution.width }} X {{ value.resolution.height }} |
{{ value.mean !== undefined ? value.mean.toFixed(2) + "px" : "-" }} |
-
- {{ value.standardDeviation !== undefined ? value.standardDeviation.toFixed(2) + "px" : "-" }}
- |
{{ value.horizontalFOV !== undefined ? value.horizontalFOV.toFixed(2) + "°" : "-" }} |
{{ value.verticalFOV !== undefined ? value.verticalFOV.toFixed(2) + "°" : "-" }} |
{{ value.diagonalFOV !== undefined ? value.diagonalFOV.toFixed(2) + "°" : "-" }} |
@@ -431,6 +510,8 @@ const endCalibration = () => {
/>
+
+
@@ -476,6 +557,96 @@ const endCalibration = () => {
+
+
+
+ {{ useCameraSettingsStore().cameraNames[useStateStore().currentCameraIndex] }} -
+ {{ calibrationDetails?.resolution.width }} x {{ calibrationDetails?.resolution.height }}
+
+
+
+
+
+ Fx: |
+ {{ calibrationDetails?.cameraIntrinsics.data[0].toFixed(2) }} mm |
+
+
+ Fy: |
+ {{ calibrationDetails?.cameraIntrinsics.data[4].toFixed(2) }} mm |
+
+
+ Cx: |
+ {{ calibrationDetails?.cameraIntrinsics.data[2].toFixed(2) }} px |
+
+
+ Cy: |
+ {{ calibrationDetails?.cameraIntrinsics.data[5].toFixed(2) }} px |
+
+
+ Distortion: |
+ [{{ calibrationDetails?.cameraExtrinsics.data.map((it) => it.toFixed(3)).join(", ") }}] |
+
+
+
+
+
+ Observations:
+
+
+
+ ID |
+ Mean Err, px |
+ Used |
+
+
+
+
+ 0 |
+ 1.23 |
+ |
+
+
+ 1 |
+ 3.33 |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/photon-client/src/components/common/LineChart.vue b/photon-client/src/components/common/LineChart.vue
new file mode 100644
index 0000000000..8a9ae06413
--- /dev/null
+++ b/photon-client/src/components/common/LineChart.vue
@@ -0,0 +1,102 @@
+
diff --git a/photon-client/src/stores/settings/CameraSettingsStore.ts b/photon-client/src/stores/settings/CameraSettingsStore.ts
index 861b192ec3..2e263bbc07 100644
--- a/photon-client/src/stores/settings/CameraSettingsStore.ts
+++ b/photon-client/src/stores/settings/CameraSettingsStore.ts
@@ -1,7 +1,6 @@
import { defineStore } from "pinia";
import type {
CalibrationBoardTypes,
- CameraCalibrationResult,
CameraSettings,
ConfigurableCameraSettings,
RobotOffsetType,
@@ -89,16 +88,7 @@ export const useCameraSettingsStore = defineStore("cameraSettings", {
standardDeviation: v.standardDeviation,
mean: v.mean
})),
- completeCalibrations: d.calibrations.map((calib) => ({
- resolution: {
- height: calib.height,
- width: calib.width
- },
- distCoeffs: calib.distCoeffs,
- standardDeviation: calib.standardDeviation,
- perViewErrors: calib.perViewErrors,
- intrinsics: calib.intrinsics
- })),
+ completeCalibrations: d.calibrations,
pipelineNicknames: d.pipelineNicknames,
currentPipelineIndex: d.currentPipelineIndex,
pipelineSettings: d.currentPipelineSettings
diff --git a/photon-client/src/types/SettingTypes.ts b/photon-client/src/types/SettingTypes.ts
index 7119b8cd90..5cdb8f51b0 100644
--- a/photon-client/src/types/SettingTypes.ts
+++ b/photon-client/src/types/SettingTypes.ts
@@ -76,16 +76,55 @@ export interface VideoFormat {
diagonalFOV?: number;
horizontalFOV?: number;
verticalFOV?: number;
- standardDeviation?: number;
mean?: number;
}
+export enum CvType {
+ CV_8U = 0,
+ CV_8S = 1,
+ CV_16U = 2,
+ CV_16S = 3,
+ CV_32S = 4,
+ CV_32F = 5,
+ CV_64F = 6,
+ CV_16F = 7
+}
+
+export interface JsonMat {
+ rows: number;
+ cols: number;
+ type: CvType;
+ data: number[];
+}
+
+export interface CvPoint3 {
+ x: number;
+ y: number;
+ z: number;
+}
+export interface CvPoint {
+ x: number;
+ y: number;
+}
+
+export interface Pose3d {
+ translation: { x: number; y: number; z: number };
+ rotation: { quaternion: { W: number; X: number; Y: number; Z: number } };
+}
+
+export interface BoardObservation {
+ locationInObjectSpace: CvPoint3[];
+ locationInImageSpace: CvPoint[];
+ reprojectionErrors: CvPoint[];
+ optimisedCameraToObject: Pose3d;
+}
+
export interface CameraCalibrationResult {
resolution: Resolution;
- distCoeffs: number[];
- standardDeviation: number;
- perViewErrors: number[];
- intrinsics: number[];
+ cameraIntrinsics: JsonMat;
+ // TODO rename to be Right
+ cameraExtrinsics: JsonMat;
+ observations: BoardObservation[];
}
export interface ConfigurableCameraSettings {
@@ -128,19 +167,54 @@ export const PlaceholderCameraSettings: CameraSettings = {
resolution: { width: 1920, height: 1080 },
fps: 60,
pixelFormat: "RGB"
- },
- {
- resolution: { width: 1280, height: 720 },
- fps: 60,
- pixelFormat: "RGB"
- },
+ }
+ // {
+ // resolution: { width: 1280, height: 720 },
+ // fps: 60,
+ // pixelFormat: "RGB"
+ // },
+ // {
+ // resolution: { width: 640, height: 480 },
+ // fps: 30,
+ // pixelFormat: "RGB"
+ // }
+ ],
+ completeCalibrations: [
{
- resolution: { width: 640, height: 480 },
- fps: 30,
- pixelFormat: "RGB"
+ resolution: { width: 1920, height: 1080 },
+ cameraIntrinsics: {
+ rows: 1,
+ cols: 1,
+ type: 1,
+ data: [1, 2, 3, 4, 5, 6, 7, 8, 9]
+ },
+ cameraExtrinsics: {
+ rows: 1,
+ cols: 1,
+ type: 1,
+ data: [10, 11, 12, 13]
+ },
+ observations: [
+ {
+ locationInImageSpace: [
+ { x: 100, y: 100 },
+ { x: 210, y: 100 },
+ { x: 320, y: 101 },
+ ],
+ locationInObjectSpace: [{ x: 0, y: 0, z: 0 }],
+ optimisedCameraToObject: {
+ translation: { x: 1, y: 2, z: 3 },
+ rotation: { quaternion: { W: 1, X: 0, Y: 0, Z: 0 } }
+ },
+ reprojectionErrors: [
+ { x: 1, y: 1 },
+ { x: 2, y: 1 },
+ { x: 3, y: 1 },
+ ]
+ }
+ ]
}
],
- completeCalibrations: [],
pipelineNicknames: ["Placeholder Pipeline"],
lastPipelineIndex: 0,
currentPipelineIndex: 0,
diff --git a/photon-client/src/types/WebsocketDataTypes.ts b/photon-client/src/types/WebsocketDataTypes.ts
index 0114e19e79..b62d2e788e 100644
--- a/photon-client/src/types/WebsocketDataTypes.ts
+++ b/photon-client/src/types/WebsocketDataTypes.ts
@@ -1,4 +1,11 @@
-import type { GeneralSettings, LightingSettings, LogLevel, MetricData, NetworkSettings } from "@/types/SettingTypes";
+import type {
+ CameraCalibrationResult,
+ GeneralSettings,
+ LightingSettings,
+ LogLevel,
+ MetricData,
+ NetworkSettings
+} from "@/types/SettingTypes";
import type { ActivePipelineSettings } from "@/types/PipelineTypes";
import type { AprilTagFieldLayout, PipelineResult } from "@/types/PhotonTrackingTypes";
@@ -46,7 +53,7 @@ export type WebsocketVideoFormat = Record<
>;
export interface WebsocketCameraSettingsUpdate {
- calibrations: WebsocketCompleteCalib[];
+ calibrations: CameraCalibrationResult[];
currentPipelineIndex: number;
currentPipelineSettings: ActivePipelineSettings;
fov: number;
diff --git a/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java b/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java
index fac672636c..60032451ea 100644
--- a/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java
+++ b/photon-core/src/main/java/org/photonvision/common/configuration/PhotonConfiguration.java
@@ -172,7 +172,7 @@ public static class UICameraConfiguration {
public HashMap> videoFormatList;
public int outputStreamPort;
public int inputStreamPort;
- public List> calibrations;
+ public List