-
Notifications
You must be signed in to change notification settings - Fork 201
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
Cropping mechanism #1602
Open
GGreenix
wants to merge
12
commits into
PhotonVision:master
Choose a base branch
from
GGreenix:cropping-mechanism
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cropping mechanism #1602
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
880ab3c
working cropping with fixed WPI tag detection
GGreenix fceb945
added other tab and mikvah
GGreenix b51a3bd
dynamic cropping is lit
GGreenix d6054d2
Add static cropping
Alextopher 7d0ba3c
add newline after license
Alextopher ffc5645
prettier
Alextopher 8b58b2f
working cropping with fixed WPI tag detection
GGreenix 43aa66d
Merge branch 'cropping-mechanism' of https://github.com/GGreenix/phot…
GGreenix 70da7ae
real resolution presented in UI
GGreenix 1caa573
Merge branch 'master' into cropping-mechanism
GGreenix 17dcc4b
test
GGreenix 30c203c
im tired.....
GGreenix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<script setup lang="ts"> | ||
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore"; | ||
import { type AprilTagPipelineSettings, type ColoredShapePipelineSettings, PipelineType } from "@/types/PipelineTypes"; | ||
import PvSlider from "@/components/common/pv-slider.vue"; | ||
import { computed, getCurrentInstance } from "vue"; | ||
import { useStateStore } from "@/stores/StateStore"; | ||
const currentPipelineSettings = computed<AprilTagPipelineSettings>( | ||
() => useCameraSettingsStore().currentPipelineSettings as AprilTagPipelineSettings | ||
); | ||
const frame_width = computed(() => useCameraSettingsStore().currentVideoFormat.resolution.width); | ||
const frame_height = computed(() => useCameraSettingsStore().currentVideoFormat.resolution.height); | ||
const static_x = computed<number>({ | ||
get: () => currentPipelineSettings.value.static_x || 0, | ||
set: (value) => useCameraSettingsStore().changeCurrentPipelineSetting({ static_x: value }, false) | ||
}); | ||
const static_y = computed<number>({ | ||
get: () => currentPipelineSettings.value.static_y || 0, | ||
set: (value) => useCameraSettingsStore().changeCurrentPipelineSetting({ static_y: value }, false) | ||
}); | ||
const static_width = computed<number>({ | ||
get: () => currentPipelineSettings.value.static_width || frame_width.value, | ||
set: (value) => useCameraSettingsStore().changeCurrentPipelineSetting({ static_width: value - static_x.value }, false) | ||
}); | ||
const static_height = computed<number>({ | ||
get: () => currentPipelineSettings.value.static_height || frame_height.value, | ||
set: (value) => useCameraSettingsStore().changeCurrentPipelineSetting({ static_height: value }, false) | ||
}); | ||
const interactiveCols = computed(() => | ||
(getCurrentInstance()?.proxy.$vuetify.breakpoint.mdAndDown || false) && | ||
(!useStateStore().sidebarFolded || useCameraSettingsStore().isDriverMode) | ||
? 9 | ||
: 8 | ||
); | ||
|
||
</script> | ||
<template> | ||
<div v-if="currentPipelineSettings.pipelineType === PipelineType.AprilTag"> | ||
<!-- static crop --> | ||
<span>Static Crop</span> | ||
<pv-slider | ||
v-model="currentPipelineSettings.static_x" | ||
class="pt-2" | ||
:slider-cols="interactiveCols" | ||
label="X" | ||
tooltip="The X coordinate of the top left corner of the statically cropped area" | ||
:min="0" | ||
:max="frame_width" | ||
/> | ||
<pv-slider | ||
v-model="currentPipelineSettings.static_y" | ||
:slider-cols="interactiveCols" | ||
label="Y" | ||
tooltip="The Y coordinate of the top left corner of the statically cropped area" | ||
:min="0" | ||
:max="frame_height" | ||
|
||
/> | ||
<pv-slider | ||
v-model="currentPipelineSettings.static_width" | ||
:slider-cols="interactiveCols" | ||
label="Width" | ||
tooltip="The width of the statically cropped area" | ||
:min="1" | ||
:max="frame_width" | ||
|
||
/> | ||
<pv-slider | ||
v-model="currentPipelineSettings.static_height" | ||
:slider-cols="interactiveCols" | ||
label="Height" | ||
tooltip="The height of the statically cropped area" | ||
:min="1" | ||
:max="frame_height" | ||
|
||
/> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not have changed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sus