Skip to content

Commit cbe6e65

Browse files
committed
enh(stereo): get rid of stereoscopic calibration dialog
keep one single import dialog for stereo
1 parent 51a3b81 commit cbe6e65

File tree

9 files changed

+25
-40
lines changed

9 files changed

+25
-40
lines changed

client/dive-common/apispec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ export interface MultiCamImportFolderArgs {
8181
sourcePath: string;
8282
trackFile: string;
8383
}>; // path/track file per camera
84-
calibrationFile?: string; // NPZ calibation matrix file
85-
stereoConfigurationFile?: string; // kwiver *.conf file
84+
calibrationFile?: string; // NPZ calibation matrix file or kwivier *.conf file
8685
type: 'image-sequence' | 'video';
8786
}
8887

@@ -93,8 +92,7 @@ export interface MultiCamImportKeywordArgs {
9392
glob: string;
9493
trackFile: string;
9594
}>; // glob pattern for base folder
96-
calibrationFile?: string; // NPZ calibation matrix file
97-
stereoConfigurationFile?: string; // kwiver *.conf file
95+
calibrationFile?: string; // NPZ calibation matrix file or kwiver *.conf file
9896
type: 'image-sequence'; // Always image-sequence type for glob matching
9997
}
10098

@@ -139,7 +137,7 @@ interface DatasetMeta extends DatasetMetaMutable {
139137
originalFps?: Readonly<number>;
140138
subType: Readonly<SubType>; // In future this could have stuff like IR/EO
141139
multiCamMedia: Readonly<MultiCamMedia | null>;
142-
stereoConfigurationFile?: Readonly<string>;
140+
calibrationFile?: Readonly<string>;
143141
}
144142

145143
interface Api {

client/dive-common/components/ImportButton.vue

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,6 @@ export default defineComponent({
113113
</v-list-item-content>
114114
</v-list-item>
115115

116-
<v-list-item
117-
v-if="openType === 'image-sequence'"
118-
style="align-items':'center"
119-
@click="$emit('multi-cam', { stereo: true, openType, calibration: true })"
120-
>
121-
<v-list-item-icon>
122-
<v-icon>mdi-binoculars</v-icon>
123-
</v-list-item-icon>
124-
<v-list-item-content>
125-
<v-list-item-title>Stereoscopic Calibration</v-list-item-title>
126-
</v-list-item-content>
127-
</v-list-item>
128116

129117
<v-list-item
130118
style="align-items':'center"

client/dive-common/components/ImportMultiCamDialog.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export default defineComponent({
5454
const pendingImportPayloads: Ref<Record<string, MediaImportResponse | null>> = ref({});
5555
const globList: Ref<Record<string, { glob: string; trackFile: string}>> = ref({});
5656
const calibrationFile = ref('');
57-
const stereoConfigurationFile = ref('');
5857
const defaultDisplay = ref('left');
5958
const importAnnotationFilesCheck = ref(false);
6059
const { error: importError, request: importRequest } = useRequest();
@@ -199,8 +198,8 @@ export default defineComponent({
199198
const path = ret.filePaths[0];
200199
if (folder === 'calibration') {
201200
calibrationFile.value = path;
202-
} else if (folder === 'stereoConfiguration') {
203-
stereoConfigurationFile.value = path;
201+
// } else if (folder === 'stereoConfiguration') {
202+
// stereoConfigurationFile.value = path;
204203
} else if (importType.value === 'multi') {
205204
if (ret.root) {
206205
folderList.value[folder].sourcePath = ret.root;
@@ -254,8 +253,8 @@ export default defineComponent({
254253
type: props.dataType,
255254
};
256255
if (props.calibration) {
257-
delete args.calibrationFile;
258-
args.stereoConfigurationFile = stereoConfigurationFile.value;
256+
// delete args.calibrationFile;
257+
// args.stereoConfigurationFile = stereoConfigurationFile.value;
259258
}
260259
261260
emit('begin-multicam-import', args);
@@ -284,7 +283,7 @@ export default defineComponent({
284283
defaultDisplay,
285284
displayKeys,
286285
importAnnotationFilesCheck,
287-
stereoConfigurationFile,
286+
// stereoConfigurationFile,
288287
//Methods
289288
open,
290289
prepForImport,
@@ -480,7 +479,7 @@ export default defineComponent({
480479
</v-btn>
481480
</v-row>
482481

483-
<v-row
482+
<!-- <v-row
484483
v-else-if="stereo && calibration"
485484
no-gutters
486485
class="align-center"
@@ -504,7 +503,7 @@ export default defineComponent({
504503
mdi-matrix
505504
</v-icon>
506505
</v-btn>
507-
</v-row>
506+
</v-row> -->
508507
</div>
509508
</div>
510509

@@ -531,7 +530,7 @@ export default defineComponent({
531530
</v-btn>
532531
<v-btn
533532
color="primary"
534-
:disabled="!nextSteps || (stereo && (!calibrationFile && !stereoConfigurationFile))"
533+
:disabled="!nextSteps || (stereo && (!calibrationFile))"
535534
@click="prepForImport"
536535
>
537536
Begin Import

client/dive-common/components/Viewer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export default defineComponent({
571571
context.resetActive();
572572
const meta = await loadMetadata(datasetId.value);
573573
574-
isStereoConfigMode.value = meta.stereoConfigurationFile != null;
574+
isStereoConfigMode.value = meta.calibrationFile != null;
575575
576576
const defaultCameraMeta = meta.multiCamMedia?.cameras[meta.multiCamMedia.defaultDisplay];
577577
baseMulticamDatasetId.value = datasetId.value;
@@ -741,7 +741,7 @@ export default defineComponent({
741741
});
742742
}
743743
744-
if (meta.stereoConfigurationFile) {
744+
if (meta.calibrationFile) {
745745
context.register({
746746
component: TrackViewerSettings,
747747
description: 'Track Viewer Settings',

client/platform/desktop/backend/native/multiCamImport.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async function beginMultiCamImport(args: MultiCamImportArgs): Promise<DesktopMed
108108
calibration: args.calibrationFile,
109109
defaultDisplay: args.defaultDisplay,
110110
},
111-
stereoConfigurationFile: args.stereoConfigurationFile,
111+
calibrationFile: args.calibrationFile,
112112
subType: null,
113113
};
114114

@@ -177,8 +177,8 @@ async function beginMultiCamImport(args: MultiCamImportArgs): Promise<DesktopMed
177177
cameras[cameraName].imageListPath = jsonMeta.originalBasePath;
178178
cameras[cameraName].originalBasePath = '';
179179
}
180-
if (args.stereoConfigurationFile) {
181-
cameras[cameraName].stereoConfigurationFile = args.stereoConfigurationFile;
180+
if (args.calibrationFile) {
181+
cameras[cameraName].calibrationFile = args.calibrationFile;
182182
}
183183
});
184184
} else if (isKeywordArgs(args)) {
@@ -194,8 +194,8 @@ async function beginMultiCamImport(args: MultiCamImportArgs): Promise<DesktopMed
194194
cameras[cameraName].imageListPath = jsonMeta.originalBasePath;
195195
cameras[cameraName].originalBasePath = '';
196196
}
197-
if (args.stereoConfigurationFile) {
198-
cameras[cameraName].stereoConfigurationFile = args.stereoConfigurationFile;
197+
if (args.calibrationFile) {
198+
cameras[cameraName].calibrationFile = args.calibrationFile;
199199
}
200200
});
201201
}
@@ -205,7 +205,7 @@ async function beginMultiCamImport(args: MultiCamImportArgs): Promise<DesktopMed
205205

206206
if (jsonMeta.multiCam?.cameras && jsonMeta.multiCam.cameras.left
207207
&& jsonMeta.multiCam.cameras.right && (
208-
jsonMeta.multiCam.calibration || jsonMeta.stereoConfigurationFile
208+
jsonMeta.multiCam.calibration
209209
)) {
210210
jsonMeta.subType = 'stereo';
211211
} else if (jsonMeta.multiCam) {

client/platform/desktop/backend/native/viame.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ async function runPipeline(
153153
throw new Error('Attempting to run a multicam pipeline on non multicam data');
154154
}
155155

156-
if (meta.stereoConfigurationFile) {
157-
command.push(`-c "${meta.stereoConfigurationFile}"`);
156+
if (meta.calibrationFile) {
157+
command.push(`-c "${meta.calibrationFile}"`);
158158

159159
if (meta.multiCam) {
160160
// eslint-disable-next-line no-restricted-syntax

client/platform/desktop/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface Camera {
4141
transcodedImageFiles: string[];
4242
transcodedVideoFile: string;
4343
imageListPath?: string;
44-
stereoConfigurationFile?: string;
44+
calibrationFile?: string;
4545
}
4646

4747
export interface MultiCamDesktop {
@@ -122,7 +122,7 @@ export interface JsonMeta extends DatasetMetaMutable {
122122
// Stereo or multi-camera datasets with uniform type (all images, all video)
123123
subType: SubType;
124124

125-
stereoConfigurationFile?: string; // kwiver *.conf file
125+
calibrationFile?: string; // kwiver *.conf file or *.npz
126126
}
127127

128128
export type DesktopMetadata = DatasetMeta & JsonMeta;

client/platform/desktop/frontend/components/ImportDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default defineComponent({
4040
}
4141
4242
// Set default attributes for a stereo calibration configuration
43-
if (argCopy.value.jsonMeta.stereoConfigurationFile) {
43+
if (argCopy.value.jsonMeta.calibrationFile) {
4444
argCopy.value.jsonMeta.attributes = {};
4545
4646
// Create x, y, z attributes

docs/UI-Attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Attributes are part of the dataset configuration that can be imported and export
102102
## Reserved Attribute Names
103103

104104
Using certain import mode, attributes definitions might be created automatically. This is documented in this section.
105-
- When importing using 'Stereoscopic Calibration' mode, the `stereo3d_x`, `stereo3d_y` and `stereo3d_z` detection attributes definitions will be created automatically.
105+
- When importing using 'Stereoscopic' mode, the `stereo3d_x`, `stereo3d_y` and `stereo3d_z` detection attributes definitions will be created automatically.
106106
They holds the 3d location of a detected fish and are used in the Track 3D Viewer.
107107

108108
## Applying Attributes Demo

0 commit comments

Comments
 (0)