8000 Calibration card and PV input styling by DevonRD · Pull Request #1695 · PhotonVision/photonvision · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Calibration card and PV input styling #1695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
<v-card class="mb-3" color="primary" dark>
<v-card-title class="pa-6 pb-3">Camera Calibration</v-card-title>
<v-card-text v-show="!isCalibrating">
<v-card-subtitle class="pt-3 pl-2 pb-3">Current Calibration</v-card-subtitle>
<v-card-subtitle class="pt-3 pl-2 pb-4 white--text">Current Calibration</v-card-subtitle>
<v-simple-table fixed-header height="100%" dense>
<thead>
<tr>
Expand Down Expand Up @@ -252,7 +252,9 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
</v-simple-table>
</v-card-text>
<v-card-text v-if="useCameraSettingsStore().isConnected" class="d-flex flex-column pa-6 pt-0">
<v-card-subtitle v-show="!isCalibrating" class="pl-0">Configure New Calibration</v-card-subtitle>
<v-card-subtitle v-show="!isCalibrating" class="pl-0 pb-3 pt-3 white--text"
>Configure New Calibration</v-card-subtitle
>
<v-form ref="form" v-model="settingsValid">
<!-- TODO: the default videoFormatIndex is 0, but the list of unique video mode indexes might not include 0. getUniqueVideoResolutionStrings indexing is also different from the normal video mode indexing -->
<pv-select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,13 @@ const calibrationImageURL = (index: number) =>
</script>

<template>
<v-card color="primary" class="pa-6" dark>
<v-row>
<v-col cols="12" md="5">
<v-card-title class="pl-0 ml-0"
><span class="text-no-wrap" style="white-space: pre !important">Calibration Details: </span
><span class="text-no-wrap"
>{{ useCameraSettingsStore().currentCameraName }}@{{ getResolutionString(videoFormat.resolution) }}</span
></v-card-title
>
<v-card color="primary" dark>
<div class="d-flex flex-wrap pr-md-3">
<v-col cols="12" md="6">
<v-card-title class="pl-3 pb-0 pb-md-4"> Calibration Details </v-card-title>
</v-col>
<v-col>
<v-btn color="secondary" class="mt-4" style="width: 100%" @click="openUploadPhotonCalibJsonPrompt">
<v-col cols="6" md="3" class="d-flex align-center pt-0 pt-md-3 pl-6 pl-md-3">
<v-btn color="secondary" style="width: 100%" @click="openUploadPhotonCalibJsonPrompt">
<v-icon left> mdi-import</v-icon>
<span>Import</span>
</v-btn>
Expand All @@ -113,10 +108,9 @@ const calibrationImageURL = (index: number) =>
@change="importCalibration"
/>
</v-col>
<v-col>
<v-col cols="6" md="3" class="d-flex align-center pt-0 pt-md-3 pr-6 pr-md-3">
<v-btn
color="secondary"
class="mt-4"
:disabled="!currentCalibrationCoeffs"
style="width: 100%"
@click="openExportCalibrationPrompt"
Expand All @@ -131,10 +125,17 @@ const calibrationImageURL = (index: number) =>
target="_blank"
/>
</v-col>
</v-row>
<v-row v-if="currentCalibrationCoeffs" class="pt-2">
<v-card-subtitle>Calibration Details</v-card-subtitle>
<v-simple-table dense style="width: 100%" class="pl-2 pr-2">
</div>
<v-card-title class="pt-0 pb-3"
>{{ useCameraSettingsStore().currentCameraName }}@{{ getResolutionString(videoFormat.resolution) }}</v-card-title
>
<v-card-text v-if="!currentCalibrationCoeffs">
<v-banner rounded color="secondary" text-color="white" class="mt-3" icon="mdi-alert-circle-outline">
The selected video format has not been calibrated.
</v-banner>
</v-card-text>
<v-card-text>
<v-simple-table dense style="width: 100%">
<template #default>
<thead>
<tr>
Expand Down Expand Up @@ -238,15 +239,16 @@ const calibrationImageURL = (index: number) =>
</tbody>
</template>
</v-simple-table>
<hr style="width: 100%" class="ma-6" />
<v-card-subtitle>Per Observation Details</v-card-subtitle>
</v-card-text>
<v-card-title v-if="currentCalibrationCoeffs" class="pt-0">Individual Observations</v-card-title>
<v-card-text v-if="currentCalibrationCoeffs">
<v-data-table
dense
style="width: 100%"
class="pl-2 pr-2"
:headers="[
{ text: 'Observation Id', value: 'index' },
{ text: 'Mean Reprojection Error', value: 'mean' }
{ text: 'Mean Reprojection Error', value: 'mean' },
{ text: '', value: 'data-table-expand' }
]"
:items="getObservationDetails()"
item-key="index"
Expand All @@ -261,10 +263,7 @@ const calibrationImageURL = (index: number) =>
</td>
</template>
</v-data-table>
</v-row>
<v-row v-else class="pt-2 mb-0 pb-0">
The selected video format doesn't have any additional information as it has yet to be calibrated.
</v-row>
</v-card-text>
</v-card>
</template>

Expand All @@ -275,7 +274,6 @@ const calibrationImageURL = (index: number) =>
.snapshot-preview {
max-width: 55%;
}

@media only screen and (max-width: 512px) {
.snapshot-preview {
max-width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions photon-client/src/components/cameras/CamerasView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ th {
text-align: center;
}

.v-input--switch {
margin-top: 0;
}

.stream-container {
display: flex;
justify-content: center;
Expand Down
5 changes: 5 additions & 0 deletions photon-client/src/components/common/pv-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ const handleKeydown = ({ key }) => {
</v-col>
</div>
</template>
<style scoped>
.v-text-field {
margin-top: 0px;
}
</style>
6 changes: 6 additions & 0 deletions photon-client/src/components/common/pv-radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ const localValue = computed({
</v-col>
</div>
</template>
<style scoped>
.v-input--radio-group {
padding-top: 0;
margin-top: 0;
}
</style>
3 changes: 2 additions & 1 deletion photon-client/src/components/common/pv-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ const items = computed<SelectItem[]>(() => {
</v-col>
</div>
</template>
<style>
<style scoped>
.v-select {
padding-top: 0px;
margin-top: 0px;
}
</style>
4 changes: 2 additions & 2 deletions photon-client/src/components/common/pv-slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const localValue = computed({

<template>
<div class="d-flex">
<v-col :cols="12 - sliderCols - 1" class="pl-0 d-flex align-center">
<v-col :cols="12 - sliderCols" class="pl-0 d-flex align-center">
<tooltipped-label :tooltip="tooltip" :label="label" />
</v-col>
<v-col :cols="sliderCols">
<v-col :cols="sliderCols - 1">
<v-slider
v-model="localValue"
dark
Expand Down
2 changes: 1 addition & 1 deletion photon-client/src/components/common/pv-switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const localValue = computed({
</v-col>
</div>
</template>
<style>
<style scoped>
.v-input--selection-controls {
margin-top: 0px;
}
Expand Down
3 changes: 3 additions & 0 deletions photon-client/src/components/dashboard/CamerasCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ const performanceRecommendation = computed<string>(() => {
</template>

<style scoped>
.v-input--switch {
margin-top: 0;
}
.stream-viewer-container {
display: flex;
justify-content: center;
Expand Down
21 changes: 13 additions & 8 deletions photon-client/src/components/dashboard/tabs/ContoursTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ const interactiveCols = computed(() =>
(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourTargetOrientation: value }, false)
"
/>
<pv-select
v-model="useCameraSettingsStore().currentPipelineSettings.contourSortMode"
label="Target Sort"
tooltip="Chooses the sorting mode used to determine the 'best' targets to provide to user code"
:select-cols="interactiveCols"
:items="['Largest', 'Smallest', 'Highest', 'Lowest', 'Rightmost', 'Leftmost', 'Centermost']"
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourSortMode: value }, false)"
/>
<pv-range-slider
v-model="contourArea"
label="Area"
Expand Down Expand Up @@ -169,6 +177,7 @@ const interactiveCols = computed(() =>
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourShape: value }, false)"
/>
<pv-slider
v-if="currentPipelineSettings.contourShape >= 1"
v-model="currentPipelineSettings.accuracyPercentage"
:disabled="currentPipelineSettings.contourShape < 1"
label="Shape Simplification"
Expand All @@ -179,6 +188,7 @@ const interactiveCols = computed(() =>
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ accuracyPercentage: value }, false)"
/>
<pv-slider
v-if="currentPipelineSettings.contourShape === 0"
v-model="currentPipelineSettings.circleDetectThreshold"
:disabled="currentPipelineSettings.contourShape !== 0"
label="Circle match distance"
Expand All @@ -191,6 +201,7 @@ const interactiveCols = computed(() =>
"
/>
<pv-slider
v-if="currentPipelineSettings.contourShape === 0"
v-model="currentPipelineSettings.maxCannyThresh"
:disabled="currentPipelineSettings.contourShape !== 0"
label="Max Canny Threshold"
Expand All @@ -200,6 +211,7 @@ const interactiveCols = computed(() =>
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ maxCannyThresh: value }, false)"
/>
<pv-slider
v-if="currentPipelineSettings.contourShape === 0"
v-model="currentPipelineSettings.circleAccuracy"
:disabled="currentPipelineSettings.contourShape !== 0"
label="Circle Accuracy"
Expand All @@ -209,6 +221,7 @@ const interactiveCols = computed(() =>
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ circleAccuracy: value }, false)"
/>
<pv-range-slider
v-if="currentPipelineSettings.contourShape === 0"
v-model="contourRadius"
:disabled="currentPipelineSettings.contourShape !== 0"
label="Radius"
Expand All @@ -218,13 +231,5 @@ const interactiveCols = computed(() =>
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourRadius: value }, false)"
/>
</template>
<pv-select
v-model="useCameraSettingsStore().currentPipelineSettings.contourSortMode"
label="Target Sort"
< CEB7 /td> tooltip="Chooses the sorting mode used to determine the 'best' targets to provide to user code"
:select-cols="interactiveCols"
:items="['Largest', 'Smallest', 'Highest', 'Lowest', 'Rightmost', 'Leftmost', 'Centermost']"
@input="(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ contourSortMode: value }, false)"
/>
</div>
</template>
13 changes: 6 additions & 7 deletions photon-client/src/components/dashboard/tabs/InputTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const interactiveCols = computed(() =>
v-model="useCameraSettingsStore().currentPipelineSettings.cameraAutoExposure"
class="pt-2"
label="Auto Exposure"
:switch-cols="interactiveCols === 8 ? 9 : interactiveCols"
:switch-cols="interactiveCols"
tooltip="Enables or Disables camera automatic adjustment for current lighting conditions"
@input="(args) => useCameraSettingsStore().changeCurrentPipelineSetting({ cameraAutoExposure: args }, false)"
/>
Expand Down Expand Up @@ -132,15 +132,14 @@ const interactiveCols = computed(() =>
/>
<pv-switch
v-model="useCameraSettingsStore().currentPipelineSettings.cameraAutoWhiteBalance"
class="pt-2"
label="Auto White Balance"
:switch-cols="interactiveCols === 8 ? 9 : interactiveCols"
:switch-cols="interactiveCols"
tooltip="Enables or Disables camera automatic adjustment for current lighting conditions"
@input="(args) => useCameraSettingsStore().changeCurrentPipelineSetting({ cameraAutoWhiteBalance: args }, false)"
/>
<pv-slider
v-if="!useCameraSettingsStore().currentPipelineSettings.cameraAutoWhiteBalance"
v-model="useCameraSettingsStore().currentPipelineSettings.cameraWhiteBalanceTemp"
:disabled="useCameraSettingsStore().currentPipelineSettings.cameraAutoWhiteBalance"
label="White Balance Temperature"
:min="useCameraSettingsStore().minWhiteBalanceTemp"
:max="useCameraSettingsStore().maxWhiteBalanceTemp"
Expand All @@ -152,23 +151,23 @@ const interactiveCols = computed(() =>
label="Orientation"
tooltip="Rotates the camera stream. Rotation not available when camera has been calibrated."
:items="cameraRotations"
:select-cols="interactiveCols === 8 ? 9 : interactiveCols"
:select-cols="interactiveCols"
@input="(args) => useCameraSettingsStore().changeCurrentPipelineSetting({ inputImageRotationMode: args }, false)"
/>
<pv-select
v-model="useCameraSettingsStore().currentPipelineSettings.cameraVideoModeIndex"
label="Resolution"
tooltip="Resolution and FPS the camera should directly capture at"
:items="cameraResolutions"
:select-cols="interactiveCols === 8 ? 9 : interactiveCols"
:select-cols="interactiveCols"
@input="(args) => handleResolutionChange(args)"
/>
<pv-select
v-model="useCameraSettingsStore().currentPipelineSettings.streamingFrameDivisor"
label="Stream Resolution"
tooltip="Resolution to which camera frames are downscaled for streaming to the dashboard"
:items="streamResolutions"
:select-cols="interactiveCols === 8 ? 9 : interactiveCols"
:select-cols="interactiveCols"
@input="(args) => handleStreamResolutionChange(args)"
/>
</div>
Expand Down
Loading
Loading
0