From 631b96bbace93170163e7c7818f9e671af20db3b Mon Sep 17 00:00:00 2001 From: Leane Hecht Date: Mon, 17 Jul 2023 10:01:29 +0200 Subject: [PATCH 1/4] Resolves #613 by disabling link-button Disable button for annotations with different label_id. --- .../js/videos/components/videoScreen/modifyInteractions.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue index 3e004aa1d..490df542d 100644 --- a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue +++ b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue @@ -30,7 +30,9 @@ export default { allowedSplitShapes.indexOf(this.selectedAnnotations[0].shape) === -1; }, cannotLinkAnnotations() { - return this.selectedAnnotations.length !== 2 || this.selectedAnnotations[0].shape_id !== this.selectedAnnotations[1].shape_id; + return this.selectedAnnotations.length !== 2 + || this.selectedAnnotations[0].shape_id !== this.selectedAnnotations[1].shape_id + || this.selectedAnnotations[0].labels[0].label_id !== this.selectedAnnotations[1].labels[0].label_id; }, isAttaching() { return this.interactionMode === 'attachLabel'; From f4affeea45088f7f952ca17a99540a7fd682d1d3 Mon Sep 17 00:00:00 2001 From: Leane Hecht Date: Mon, 17 Jul 2023 10:07:18 +0200 Subject: [PATCH 2/4] Update manual --- .../manual/tutorials/videos/editing-video-annotations.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/manual/tutorials/videos/editing-video-annotations.blade.php b/resources/views/manual/tutorials/videos/editing-video-annotations.blade.php index 8d5668747..612f09c15 100644 --- a/resources/views/manual/tutorials/videos/editing-video-annotations.blade.php +++ b/resources/views/manual/tutorials/videos/editing-video-annotations.blade.php @@ -22,7 +22,7 @@

Link annotation clips

- Sometimes an object or region of interest (ROI) might disappear from the video and reappear at a later time. To still count this object or ROI as a single annotation, annotation clips can be linked. First, create two separate annotation clips, marking the object or ROI at both times at which it is visible in the video. Next, select both annotation clips. Finally, click the button in the tool bar to link the two annotation clips. The result is a single annotation clip with a gap, which is marked with a dotted line between two keyframes. You can repeat this process to create an annotation clip with several gaps. + Sometimes an object or region of interest (ROI) might disappear from the video and reappear at a later time. To still count this object or ROI as a single annotation, annotation clips can be linked. First, create two separate annotation clips of equal label and shape, marking the object or ROI at both times at which it is visible in the video. Next, select both annotation clips. Finally, click the button in the tool bar to link the two annotation clips. The result is a single annotation clip with a gap, which is marked with a dotted line between two keyframes. You can repeat this process to create an annotation clip with several gaps.


From f3f30deeb99488e3a19c977332985886a0ee9480 Mon Sep 17 00:00:00 2001 From: Leane Hecht Date: Tue, 8 Aug 2023 09:01:15 +0200 Subject: [PATCH 3/4] Add check for all labels Enable annotation linking, if all annotations belong to the same set of labels. --- .../components/videoScreen/modifyInteractions.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue index 490df542d..4c722c72c 100644 --- a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue +++ b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue @@ -30,9 +30,10 @@ export default { allowedSplitShapes.indexOf(this.selectedAnnotations[0].shape) === -1; }, cannotLinkAnnotations() { - return this.selectedAnnotations.length !== 2 - || this.selectedAnnotations[0].shape_id !== this.selectedAnnotations[1].shape_id - || this.selectedAnnotations[0].labels[0].label_id !== this.selectedAnnotations[1].labels[0].label_id; + return this.selectedAnnotations.length !== 2 + || this.selectedAnnotations[0].shape_id !== this.selectedAnnotations[1].shape_id + || this.selectedAnnotations[0].labels.length !== this.selectedAnnotations[1].labels.length + || !this.getAnnotationLabelIds(0).every(labelId => this.getAnnotationLabelIds(1).includes(labelId)); }, isAttaching() { return this.interactionMode === 'attachLabel'; @@ -42,6 +43,9 @@ export default { }, }, methods: { + getAnnotationLabelIds(index){ + return this.selectedAnnotations[index].labels.map(l => l.label_id); + }, initModifyInteraction(map) { // Map to detect which features were changed between modifystart and // modifyend events of the modify interaction. From 71800e2af133e7558018d5b35a079aa0ef13488e Mon Sep 17 00:00:00 2001 From: Leane Hecht Date: Wed, 9 Aug 2023 09:33:10 +0200 Subject: [PATCH 4/4] Add compare method to check array equality --- .../videos/components/videoScreen/modifyInteractions.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue index 4c722c72c..d8823ed08 100644 --- a/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue +++ b/resources/assets/js/videos/components/videoScreen/modifyInteractions.vue @@ -33,7 +33,7 @@ export default { return this.selectedAnnotations.length !== 2 || this.selectedAnnotations[0].shape_id !== this.selectedAnnotations[1].shape_id || this.selectedAnnotations[0].labels.length !== this.selectedAnnotations[1].labels.length - || !this.getAnnotationLabelIds(0).every(labelId => this.getAnnotationLabelIds(1).includes(labelId)); + || !this.labelsAreIdentical(this.selectedAnnotations[0], this.selectedAnnotations[1]); }, isAttaching() { return this.interactionMode === 'attachLabel'; @@ -43,8 +43,11 @@ export default { }, }, methods: { - getAnnotationLabelIds(index){ - return this.selectedAnnotations[index].labels.map(l => l.label_id); + labelsAreIdentical(a, b) { + let labelIdsA = a.labels.map(l => l.label_id); + let labelIdsB = b.labels.map(l => l.label_id); + + return labelIdsA.every(id => labelIdsB.includes(id)); }, initModifyInteraction(map) { // Map to detect which features were changed between modifystart and