mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-29 02:21:41 +00:00
* Add native stuff * use runtimeloader * add more native methods * more stuff * Switch JNI methods to static * Remove non-java classes from the picam jni * Add gradle task for JNI generation * Migrate my previous GPU accel work * Initial work on defining JNI interface * Change libpicam to a symlink for now * Initial work on adding no-copy OMX GPU accel on the pi * Make DIRECT_OMX GPU accel mode not crash * Clean up OMX changes (still not getting valid data back) * Re-add GPU unit test * A couple debugging tweaks/notes * Add temporary special cases to get RGB out of ProcessingMode.NONE * Code clarity improvements; fix possible VBO bug * Get DIRECT_OMX working * Remove some debugging switches in GPUAccelerator * Pipe in VCSM stuff to read out pixels FAST * Apply Spotless * Revert versioningHelper changes * Add missing import * Convert to MMAL and move everything to native * Re-add shared object * Rework to use MMAL and do everything natively * Condense pipeline settings classes * Add OutputStreamPipeline * Apply spotless * Fix duplicate variable inits and add more video modes * Integrate color frames and latency measurements for GPU * Fix camera detection on pi and other platforms * Add proper color copy disabling and camera settings calls * Fix things that were broken by rebase * Fix spotless issues and remove uneeded prints * Remove libpicam symlink * Fix stream resolution limiting * Remove testing code in GPUAcceleratedHSVPipe * Make profiling options general to all computers * Make PicamJNI load from resources * run spotlessApply * Address review comments * Update Maven repo for JOGL * Fix release race condition * Only run GPU accel test on the pi * Lint fix and merge conflict accident fixes * Make Jackson ignore extra fields when unmarshalling HardwareConfig * Fix Mat releasing data race * Spotless apply * Remove broken header generation task * Fix shared library loading typo * Add a ZeroCopyPicam quirk to allow setting gain with the MMAL backend * Make sure that exposure/brightness/gain get set after res changes * Make rawInputMat properly local * Remove bogus set of shouldRun flag * Clean up small GPUHSVPipe print * Add in some things that missed the ZeroCopyPiCameraSource rename * Fix incorrect scoping introduced in past rebase * Don't filter out too-low resolutions * Only show latency when GPU accel is enabled * Don't free Mats in stream thread before we use them * Fix use-after-free and latency caluclation bugs on USB camera source * Update libpicam * Remove unwanted print * Add libpicam forceLoad in unit test * Fix streaming during camera calibration * Fix zerocopy Picam calculation * Use logger trace method instead of raw prints * Fix calibration and driver mode pipes with the Picam Co-authored-by: Matt <matthew.morley.ca@gmail.com> Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
185 lines
6.9 KiB
Vue
185 lines
6.9 KiB
Vue
<template>
|
|
<div>
|
|
<CVslider
|
|
v-model="cameraExposure"
|
|
name="Exposure"
|
|
min="0"
|
|
max="100"
|
|
step="0.1"
|
|
tooltip="Directly controls how much light is allowed to fall onto the sensor, which affects brightness"
|
|
:slider-cols="largeBox"
|
|
@input="handlePipelineData('cameraExposure')"
|
|
@rollback="e => rollback('cameraExposure', e)"
|
|
/>
|
|
<CVslider
|
|
v-model="cameraBrightness"
|
|
name="Brightness"
|
|
min="0"
|
|
max="100"
|
|
tooltip="Controls camera postprocessing that brightens or darkens the image uniformly"
|
|
:slider-cols="largeBox"
|
|
@input="handlePipelineData('cameraBrightness')"
|
|
@rollback="e => rollback('cameraBrightness', e)"
|
|
/>
|
|
<CVslider
|
|
v-if="cameraGain !== -1"
|
|
v-model="cameraGain"
|
|
name="Gain"
|
|
min="0"
|
|
max="100"
|
|
tooltip="Controls automatic white balance gain, which affects how the camera captures colors in different conditions"
|
|
:slider-cols="largeBox"
|
|
@input="handlePipelineData('cameraGain')"
|
|
@rollback="e => rollback('cameraGain', e)"
|
|
/>
|
|
<CVselect
|
|
v-model="inputImageRotationMode"
|
|
name="Orientation"
|
|
tooltip="Rotates the camera stream"
|
|
:list="['Normal','90° CW','180°','90° CCW']"
|
|
:select-cols="largeBox"
|
|
@input="handlePipelineData('inputImageRotationMode')"
|
|
@rollback="e => rollback('inputImageRotationMode',e)"
|
|
/>
|
|
<CVselect
|
|
v-model="cameraVideoModeIndex"
|
|
name="Resolution"
|
|
tooltip="Resolution and FPS the camera should directly capture at"
|
|
:list="resolutionList"
|
|
:select-cols="largeBox"
|
|
@input="handlePipelineData('cameraVideoModeIndex')"
|
|
@rollback="e => rollback('cameraVideoModeIndex', e)"
|
|
/>
|
|
<CVselect
|
|
v-model="streamingFrameDivisor"
|
|
name="Stream Resolution"
|
|
tooltip="Resolution to which camera frames are downscaled for streaming to the dashboard"
|
|
:list="streamResolutionList"
|
|
:select-cols="largeBox"
|
|
@rollback="e => rollback('streamingFrameDivisor', e)"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import CVslider from '../../components/common/cv-slider'
|
|
import CVselect from '../../components/common/cv-select'
|
|
|
|
const unfilteredStreamDivisors = [1, 2, 4, 6];
|
|
|
|
export default {
|
|
name: 'Input',
|
|
components: {
|
|
CVslider,
|
|
CVselect,
|
|
},
|
|
// eslint-disable-next-line vue/require-prop-types
|
|
props: ['value'],
|
|
data() {
|
|
return {
|
|
rawStreamDivisorIndex: 0,
|
|
}
|
|
},
|
|
computed: {
|
|
largeBox: {
|
|
get() {
|
|
// Sliders and selectors should be fuller width if we're on screen size medium and
|
|
// up and either not in compact mode (because the tab will be 100% screen width),
|
|
// or in driver mode (where the card will also be 100% screen width).
|
|
return this.$vuetify.breakpoint.mdAndUp && (!this.$store.state.compactMode || this.$store.getters.isDriverMode) ? 10 : 8;
|
|
}
|
|
},
|
|
cameraExposure: {
|
|
get() {
|
|
return parseFloat(this.$store.getters.currentPipelineSettings.cameraExposure);
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mutatePipeline", {"cameraExposure": parseFloat(val)});
|
|
}
|
|
},
|
|
cameraBrightness: {
|
|
get() {
|
|
return parseInt(this.$store.getters.currentPipelineSettings.cameraBrightness)
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mutatePipeline", {"cameraBrightness": parseInt(val)});
|
|
}
|
|
},
|
|
cameraGain: {
|
|
get() {
|
|
return parseInt(this.$store.getters.currentPipelineSettings.cameraGain)
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mutatePipeline", {"cameraGain": parseInt(val)});
|
|
}
|
|
},
|
|
inputImageRotationMode: {
|
|
get() {
|
|
return this.$store.getters.currentPipelineSettings.inputImageRotationMode
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mutatePipeline", {"inputImageRotationMode": val});
|
|
}
|
|
},
|
|
cameraVideoModeIndex: {
|
|
get() {
|
|
return this.$store.getters.currentPipelineSettings.cameraVideoModeIndex;
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mutatePipeline", {"cameraVideoModeIndex": val});
|
|
|
|
this.handlePipelineUpdate("streamingFrameDivisor", this.getNumSkippedStreamDivisors());
|
|
this.rawStreamDivisorIndex = 0;
|
|
}
|
|
},
|
|
streamingFrameDivisor: {
|
|
get() {
|
|
return this.rawStreamDivisorIndex;
|
|
},
|
|
set(val) {
|
|
this.rawStreamDivisorIndex = val;
|
|
this.handlePipelineUpdate("streamingFrameDivisor", this.getNumSkippedStreamDivisors() + val);
|
|
}
|
|
},
|
|
|
|
resolutionList: {
|
|
get() {
|
|
let tmp_list = [];
|
|
for (let i of this.$store.getters.videoFormatList) {
|
|
tmp_list.push(`${i['width']} X ${i['height']} at ${i['fps']} FPS, ${i['pixelFormat']}`)
|
|
}
|
|
return tmp_list;
|
|
}
|
|
},
|
|
|
|
streamResolutionList: {
|
|
get() {
|
|
const cam_res = this.$store.getters.videoFormatList[
|
|
this.$store.getters.currentCameraSettings.currentPipelineSettings.cameraVideoModeIndex];
|
|
let tmp_list = [];
|
|
for (const x of this.getRawStreamDivisors()) {
|
|
tmp_list.push(`${Math.floor(cam_res['width'] / x)} X ${Math.floor(cam_res['height'] / x)}`);
|
|
}
|
|
return tmp_list;
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
getRawStreamDivisors() {
|
|
// Limit stream res when GPU acceleration is enabled because we *know* that we won't be able to get smooth streams above ~640x480
|
|
// It would probably be cleaner if this checked that we're on the Raspi 3 instead of checking for GPU accel status
|
|
const width = this.$store.getters.videoFormatList[
|
|
this.$store.getters.currentCameraSettings.currentPipelineSettings.cameraVideoModeIndex]['width'];
|
|
return unfilteredStreamDivisors.filter((x) => !this.$store.state.settings.general.gpuAcceleration || width / x < 400);
|
|
},
|
|
getNumSkippedStreamDivisors() {
|
|
return unfilteredStreamDivisors.length - this.getRawStreamDivisors().length;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|