bonn-activity-maps / bam_annotation_tool

Bonn Activity Maps annotation tool
4 stars 1 forks source link

extend length of limb in 3D #310

Closed jutanke closed 4 years ago

jutanke commented 4 years ago

To annotate limbs it would be good to be able to extend/retract the length of a limb: that means that the "end point" of the limb stays fixed and that the second endpoint will be extended in the already defined direction to the given length.

The limbs on which this should work are:

The math for this is fairly easy:

import numpy as np
import numpy.linalg as la

start_joint = np.array([x1, y1, z1])
end_joint = np.array([x2, y2, z2])
defined_limb_length = 123.4 # {float}

v = end_joint - start_joint
v = (v / la.norm(v)) * defined_limb_length

end_point_new = start_point + v
jutanke commented 4 years ago

@Belberus @beapc18 how much effort do you think this would be: it would be a real help and I would say this task has to be prioritised

Belberus commented 4 years ago

So it would be just like:

If it is only that, it is not complicated. We can probably do everything in the frontend and finish with an Update to the server.

jutanke commented 4 years ago

The problem with doing that in the frontend only is that you need 3D information. Is 3D information available to the frontend?

Belberus commented 4 years ago

Yeah we keep 3D information in the frontend.

jutanke commented 4 years ago

well, that makes it easy then. So do all of it in the frontend :)

However, it would be nice if the length is a fixed entry per person. It has some "default" value (maybe 0) and once it is set it will be the same during the entire dataset

jutanke commented 4 years ago

I would say the easiest way to tackle this is: each person gets additional data entries in the database:

This values are all initialized to -1 which indicates: not set. Whenever a range is loaded in the frontend, this values are being communicated to the frontend. The visualization and the selection of proper values can be done in the Keypoint Object Editor where the orange lines are edited:

image

As an alternative they can be put to where the mugshot is now.

When the user changes the values, s/he need to input them via keyboard and press a "save" button for the limbs (or re-use the same save button you have at the moment: whatever is easier).

When the value is -1 and the user attempts to extend/retract a limb a warning should be shown + nothing should be executed.

When the value > 0 the limb should be scaled accordingly (in the frontend only, if possible).

Belberus commented 4 years ago

API requests: updateLimbsLengths -> UID, newLimbLengths, etc || Update the stored values for limbs in the database for that object. getLimbsLengths -> UID, etc || Return the stored limb values from the database.

beapc18 commented 4 years ago

Tasks: