2023-08-21 01:51:35 -04:00
< script setup lang = "ts" >
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore" ;
2024-01-02 11:03:16 -05:00
import { PipelineType , type ActivePipelineSettings } from "@/types/PipelineTypes" ;
2023-10-17 16:32:59 -04:00
import PvSlider from "@/components/common/pv-slider.vue" ;
2023-10-24 19:39:38 -07:00
import PvSwitch from "@/components/common/pv-switch.vue" ;
import PvRangeSlider from "@/components/common/pv-range-slider.vue" ;
import PvSelect from "@/components/common/pv-select.vue" ;
2025-05-06 18:21:41 -04:00
import { computed } from "vue" ;
2023-08-21 01:51:35 -04:00
import { useStateStore } from "@/stores/StateStore" ;
2025-05-06 18:21:41 -04:00
import { useDisplay } from "vuetify" ;
2023-08-21 01:51:35 -04:00
// TODO fix pipeline typing in order to fix this, the store settings call should be able to infer that only valid pipeline type settings are exposed based on pre-checks for the entire config section
// Defer reference to store access method
2024-01-02 11:03:16 -05:00
const currentPipelineSettings = computed < ActivePipelineSettings > (
( ) => useCameraSettingsStore ( ) . currentPipelineSettings
) ;
2025-05-06 18:21:41 -04:00
const { mdAndDown } = useDisplay ( ) ;
2024-01-16 22:23:05 -05:00
const interactiveCols = computed ( ( ) =>
2025-05-06 18:21:41 -04:00
mdAndDown . value && ( ! useStateStore ( ) . sidebarFolded || useCameraSettingsStore ( ) . isDriverMode ) ? 8 : 7
2024-01-16 22:23:05 -05:00
) ;
2023-08-21 01:51:35 -04:00
< / script >
< template >
< div v-if = "currentPipelineSettings.pipelineType === PipelineType.Aruco" >
2023-10-24 19:39:38 -07:00
< pv-select
v - model = "currentPipelineSettings.tagFamily"
label = "Target family"
2024-12-27 20:14:30 -05:00
: items = "['AprilTag Family 36h11', 'AprilTag Family 16h5']"
2023-10-24 19:39:38 -07:00
: select - cols = "interactiveCols"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ tagFamily: value }, false)"
2023-10-24 19:39:38 -07:00
/ >
< pv-range-slider
v - model = "currentPipelineSettings.threshWinSizes"
label = "Thresh Min/Max Size"
tooltip = "The minimum and maximum adaptive threshold window size. Larger windows tend more towards global thresholding, but small windows can be weak to noise."
: min = "3"
: max = "255"
2023-08-21 01:51:35 -04:00
: slider - cols = "interactiveCols"
2023-10-24 19:39:38 -07:00
: step = "2"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "
( value ) => useCameraSettingsStore ( ) . changeCurrentPipelineSetting ( { threshWinSizes : value } , false )
"
2023-08-21 01:51:35 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-slider
2023-10-24 19:39:38 -07:00
v - model = "currentPipelineSettings.threshStepSize"
2023-08-21 01:51:35 -04:00
: slider - cols = "interactiveCols"
2023-10-24 19:39:38 -07:00
label = "Thresh Step Size"
tooltip = "Smaller values will cause more steps between the min/max sizes. More, varied steps can improve detection robustness to lighting, but may decrease performance."
: min = "2"
: max = "128"
: step = "1"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "
( value ) => useCameraSettingsStore ( ) . changeCurrentPipelineSetting ( { threshStepSize : value } , false )
"
2023-08-21 01:51:35 -04:00
/ >
2023-10-17 16:32:59 -04:00
< pv-slider
2023-10-24 19:39:38 -07:00
v - model = "currentPipelineSettings.threshConstant"
2023-08-21 01:51:35 -04:00
: slider - cols = "interactiveCols"
2023-10-24 19:39:38 -07:00
label = "Thresh Constant"
tooltip = "Affects the threshold window mean value cutoff for all steps. Higher values can improve performance, but may harm detection rate."
: min = "0"
: max = "128"
: step = "1"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "
( value ) => useCameraSettingsStore ( ) . changeCurrentPipelineSetting ( { threshConstant : value } , false )
"
2023-10-24 19:39:38 -07:00
/ >
2025-01-07 08:45:39 -05:00
< pv-switch
v - model = "currentPipelineSettings.useCornerRefinement"
label = "Refine Corners"
tooltip = "Further refine the initial corners with subpixel accuracy."
: switch - cols = "interactiveCols"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "
( value ) => useCameraSettingsStore ( ) . changeCurrentPipelineSetting ( { useCornerRefinement : value } , false )
"
2025-01-07 08:45:39 -05:00
/ >
2023-10-24 19:39:38 -07:00
< pv-switch
v - model = "currentPipelineSettings.debugThreshold"
label = "Debug Threshold"
tooltip = "Display the first threshold step to the color stream."
: switch - cols = "interactiveCols"
2025-05-06 18:21:41 -04:00
@ update : modelValue = "
( value ) => useCameraSettingsStore ( ) . changeCurrentPipelineSetting ( { debugThreshold : value } , false )
"
2023-08-21 01:51:35 -04:00
/ >
< / div >
< / template >