@@ -81,11 +81,15 @@ const patternHeight = ref(8);
81
81
const boardType = ref <CalibrationBoardTypes >(CalibrationBoardTypes .Charuco );
82
82
const useOldPattern = ref (false );
83
83
const tagFamily = ref <CalibrationTagFamilies >(CalibrationTagFamilies .Dict_4X4_1000 );
84
-
85
- // Emperical testing - with stack size limit of 1MB, we can handle at -least- 700k points
86
- const tooManyPoints = computed (
87
- () => useStateStore ().calibrationData .imageCount * patternWidth .value * patternHeight .value > 700000
88
- );
84
+ const useMrCalRef = ref (true );
85
+ const useMrCal = computed <boolean >({
86
+ get() {
87
+ return useMrCalRef .value && useSettingsStore ().general .mrCalWorking ;
88
+ },
89
+ set(value ) {
90
+ useMrCalRef .value = value && useSettingsStore ().general .mrCalWorking ;
91
+ }
92
+ });
89
93
90
94
const downloadCalibBoard = () => {
91
95
const doc = new JsPDF ({ unit: " in" , format: " letter" });
@@ -165,6 +169,7 @@ const startCalibration = () => {
165
169
patternHeight: patternHeight .value ,
166
170
patternWidth: patternWidth .value ,
167
171
boardType: boardType .value ,
172
+ useMrCal: useMrCal .value ,
168
173
useOldPattern: useOldPattern .value ,
169
174
tagFamily: tagFamily .value
170
175
});
@@ -196,8 +201,6 @@ const endCalibration = () => {
196
201
});
197
202
};
198
203
199
- let drawAllSnapshots = ref (true );
200
-
201
204
let showCalDialog = ref (false );
202
205
let selectedVideoFormat = ref <VideoFormat | undefined >(undefined );
203
206
const setSelectedVideoFormat = (format : VideoFormat ) => {
@@ -248,7 +251,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
248
251
<pv-select
249
252
v-model =" useStateStore().calibrationData.videoFormatIndex"
250
253
label =" Resolution"
251
- :select-cols =" 8 "
254
+ :select-cols =" 7 "
252
255
:disabled =" isCalibrating"
253
256
tooltip =" Resolution to calibrate at (you will have to calibrate every resolution you use 3D mode on)"
254
257
:items =" getUniqueVideoResolutionStrings()"
@@ -259,14 +262,14 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
259
262
label =" Decimation"
260
263
tooltip =" Resolution to which camera frames are downscaled for detection. Calibration still uses full-res"
261
264
:items =" calibrationDivisors"
262
- :select-cols =" 8 "
265
+ :select-cols =" 7 "
263
266
@input =" (v) => useCameraSettingsStore().changeCurrentPipelineSetting({ streamingFrameDivisor: v }, false)"
264
267
/>
265
268
<pv-select
266
269
v-model =" boardType"
267
270
label =" Board Type"
268
271
tooltip =" Calibration board pattern to use"
269
- :select-cols =" 8 "
272
+ :select-cols =" 7 "
270
273
:items =" ['Chessboard', 'Charuco']"
271
274
:disabled =" isCalibrating"
272
275
/>
@@ -275,7 +278,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
275
278
v-model =" tagFamily"
276
279
label =" Tag Family"
277
280
tooltip =" Dictionary of aruco markers on the charuco board"
278
- :select-cols =" 8 "
281
+ :select-cols =" 7 "
279
282
:items =" ['Dict_4X4_1000', 'Dict_5X5_1000', 'Dict_6X6_1000', 'Dict_7X7_1000']"
280
283
:disabled =" isCalibrating"
281
284
/>
@@ -285,7 +288,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
285
288
tooltip =" Spacing between pattern features in inches"
286
289
:disabled =" isCalibrating"
287
290
:rules =" [(v) => v > 0 || 'Size must be positive']"
288
- :label-cols =" 4 "
291
+ :label-cols =" 5 "
289
292
/>
290
293
<pv-number-input
291
294
v-show =" boardType == CalibrationBoardTypes.Charuco"
@@ -294,42 +297,39 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
294
297
tooltip =" Size of the tag markers in inches must be smaller than pattern spacing"
295
298
:disabled =" isCalibrating"
296
299
:rules =" [(v) => v > 0 || 'Size must be positive']"
297
- :label-cols =" 4 "
300
+ :label-cols =" 5 "
298
301
/>
299
302
<pv-number-input
300
303
v-model =" patternWidth"
301
304
label =" Board Width (squares)"
302
305
tooltip =" Width of the board in dots or chessboard squares"
303
306
:disabled =" isCalibrating"
304
307
:rules =" [(v) => v >= 4 || 'Width must be at least 4']"
305
- :label-cols =" 4 "
308
+ :label-cols =" 5 "
306
309
/>
307
310
<pv-number-input
308
311
v-model =" patternHeight"
309
312
label =" Board Height (squares)"
310
313
tooltip =" Height of the board in dots or chessboard squares"
311
314
:disabled =" isCalibrating"
312
315
:rules =" [(v) => v >= 4 || 'Height must be at least 4']"
313
- :label-cols =" 4 "
316
+ :label-cols =" 5 "
314
317
/>
315
318
<pv-switch
316
319
v-show =" boardType == CalibrationBoardTypes.Charuco"
317
320
v-model =" useOldPattern"
318
321
label =" Old OpenCV Pattern"
319
322
:disabled =" isCalibrating"
320
323
tooltip =" If enabled, Photon will use the old OpenCV pattern for calibration."
321
- :label-cols =" 4"
324
+ :label-cols =" 5"
325
+ />
326
+ <pv-switch
327
+ v-model =" useMrCal"
328
+ label =" Try using MrCal over OpenCV"
329
+ :disabled =" !useSettingsStore().general.mrCalWorking || isCalibrating"
330
+ tooltip =" If enabled, Photon will (try to) use MrCal instead of OpenCV for camera calibration."
331
+ :label-cols =" 5"
322
332
/>
323
- <v-banner
324
- v-show =" useSettingsStore().general.mrCalWorking"
325
- rounded
326
- color =" secondary"
327
- text-color =" white"
328
- class =" mt-3"
329
- icon =" mdi-alert-circle-outline"
330
- >
331
- Mrcal was successfully loaded, and will be used!
332
- </v-banner >
333
333
<v-banner
334
334
v-show =" !useSettingsStore().general.mrCalWorking"
335
335
rounded
@@ -418,17 +418,12 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
418
418
</v-col >
419
419
</v-row >
420
420
<v-row >
421
- <v-col v-if =" tooManyPoints" :cols =" 12" >
422
- <v-banner rounded color =" red" text-color =" white" class =" mt-3" icon =" mdi-alert-circle-outline" >
423
- Too many corners - finish calibration now!
424
- </v-banner >
425
- </v-col >
426
421
<v-col :cols =" 6" >
427
422
<v-btn
428
423
small
429
424
color =" secondary"
430
425
style =" width : 100% "
431
- :disabled =" !settingsValid || tooManyPoints "
426
+ :disabled =" !settingsValid"
432
427
@click =" isCalibrating ? useCameraSettingsStore().takeCalibrationSnapshot() : startCalibration()"
433
428
>
434
429
<v-icon left class =" calib-btn-icon" > {{ isCalibrating ? "mdi-camera" : "mdi-flag-outline" }} </v-icon >
@@ -468,16 +463,6 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
468
463
</v-btn >
469
464
</v-col >
470
465
</v-row >
471
- <v-row v-if =" isCalibrating" style =" display : flex ; flex-direction : column " >
472
- <pv-switch
473
- v-model =" drawAllSnapshots"
474
- class =" pt-2"
475
- label =" Draw Collected Corners"
476
- :switch-cols =" 8"
477
- tooltip =" Draw all snapshots"
478
- @input =" (args) => useCameraSettingsStore().changeCurrentPipelineSetting({ drawAllSnapshots: args }, false)"
479
- />
480
- </v-row >
481
466
</div >
482
467
</v-card >
483
468
<v-dialog v-model =" showCalibEndDialog" width =" 500px" :persistent =" true" >
0 commit comments