2023-08-21 01:51:35 -04:00
< script setup lang = "ts" >
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore" ;
import { PipelineType } 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" ;
2023-08-21 01:51:35 -04:00
import { computed , getCurrentInstance } from "vue" ;
import { useStateStore } from "@/stores/StateStore" ;
// 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
const currentPipelineSettings = useCameraSettingsStore ( ) . currentPipelineSettings ;
2023-08-31 16:56:58 -04:00
const interactiveCols = computed (
( ) =>
( getCurrentInstance ( ) ? . proxy . $vuetify . breakpoint . mdAndDown || false ) &&
( ! useStateStore ( ) . sidebarFolded || useCameraSettingsStore ( ) . isDriverMode )
)
? 9
: 8 ;
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"
: items = "['AprilTag Family 36h11', 'AprilTag Family 25h9', 'AprilTag Family 16h5']"
: select - cols = "interactiveCols"
@ input = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ tagFamily: value }, false)"
/ >
< pv-switch
v - model = "currentPipelineSettings.useCornerRefinement"
2023-08-21 01:51:35 -04:00
class = "pt-2"
2023-10-24 19:39:38 -07:00
label = "Refine Corners"
tooltip = "Further refine the initial corners with subpixel accuracy."
: switch - cols = "interactiveCols"
@ input = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ useCornerRefinement: value }, false)"
/ >
< 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"
@ input = "(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
class = "pt-2"
: 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"
@ input = "(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
class = "pt-2"
: 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"
@ input = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ threshConstant: value }, false)"
/ >
< pv-switch
v - model = "currentPipelineSettings.debugThreshold"
class = "pt-2"
label = "Debug Threshold"
tooltip = "Display the first threshold step to the color stream."
: switch - cols = "interactiveCols"
@ input = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ debugThreshold: value }, false)"
2023-08-21 01:51:35 -04:00
/ >
< / div >
< / template >