assistive-rehab
|
Basic class for skeleton standard. More...
#include <skeleton.h>
Public Member Functions | |
SkeletonStd () | |
Default constructor. | |
bool | update_planes () override |
Update skeleton planes. More... | |
const std::string & | getType () const |
Return a reference to the type of the skeleton. More... | |
void | setTag (const std::string &tag) |
Set the tag of the skeleton. More... | |
const std::string & | getTag () const |
Return a reference to the tag of the skeleton. More... | |
bool | setTransformation (const yarp::sig::Matrix &T) |
Set a new transformation matrix of the skeleton. More... | |
const yarp::sig::Matrix & | getTransformation () const |
Retrieve the transformation matrix of the skeleton. More... | |
bool | setCoronal (const yarp::sig::Vector &coronal) |
Set a new coronal plane to the skeleton. More... | |
bool | setSagittal (const yarp::sig::Vector &sagittal) |
Set a new sagittal plane to the skeleton. More... | |
bool | setTransverse (const yarp::sig::Vector &transverse) |
Set a new transverse plane to the skeleton. More... | |
yarp::sig::Vector | getCoronal () const |
Retrieve the coronal plane of the skeleton. More... | |
yarp::sig::Vector | getSagittal () const |
Retrieve the sagittal plane of the skeleton. More... | |
yarp::sig::Vector | getTransverse () const |
Retrieve the transverse plane of the skeleton. More... | |
double | getMaxPath () const |
Retrieve the skeleton's maximum path. More... | |
virtual yarp::os::Property | toProperty () |
Export the skeleton structure as a property. More... | |
virtual void | fromProperty (const yarp::os::Property &prop) |
Import the skeleton structure from its properties. More... | |
unsigned int | getNumKeyPoints () const |
Retrieve the number of keypoints of the skeleton. More... | |
int | getNumFromKey (const std::string &tag) const |
Retrieve the index of the keypoint from its tag. More... | |
const KeyPoint * | operator[] (const std::string &tag) const |
Keypoint access. More... | |
const KeyPoint * | operator[] (const unsigned int i) const |
Keypoint access. More... | |
virtual void | update () |
Update skeleton. | |
virtual void | update (const std::vector< yarp::sig::Vector > &ordered) |
Update skeleton from ordered list. More... | |
virtual void | update (const std::vector< std::pair< std::string, yarp::sig::Vector >> &unordered) |
Update skeleton from unordered list. More... | |
virtual void | update (const yarp::os::Property &prop) |
Update skeleton from properties. More... | |
virtual void | update_withpixels (const std::vector< std::pair< yarp::sig::Vector, yarp::sig::Vector >> &ordered) |
Update skeleton from ordered list. More... | |
virtual void | update_withpixels (const std::vector< std::pair< std::string, std::pair< yarp::sig::Vector, yarp::sig::Vector >>> &unordered) |
Update skeleton from unordered list. More... | |
virtual std::vector< yarp::sig::Vector > | get_ordered () const |
Retrieve the ordered list of keypoints. More... | |
virtual std::vector< std::pair< std::string, yarp::sig::Vector > > | get_unordered () const |
Retrieve the unordered list of keypoints. More... | |
virtual std::vector< std::pair< yarp::sig::Vector, yarp::sig::Vector > > | get_ordered_withpixels () const |
Retrieve the ordered list of keypoints. More... | |
virtual std::vector< std::pair< std::string, std::pair< yarp::sig::Vector, yarp::sig::Vector > > > | get_unordered_withpixels () const |
Retrieve the unordered list of keypoints. More... | |
void | normalize (const double n=1.0) |
Normalize skeleton in order to have unitary/desired distance among keypoints. More... | |
void | scale (const double s) |
Rescale skeleton. More... | |
void | print (std::ostream &os=std::cout) const |
Print skeleton information. | |
Protected Member Functions | |
yarp::os::Property | helper_toproperty (KeyPoint *k) const |
void | helper_fromproperty (yarp::os::Bottle *prop, KeyPoint *parent) |
void | helper_updatefromproperty (yarp::os::Bottle *prop) |
void | helper_normalize (KeyPoint *k, const std::vector< yarp::sig::Vector > &helperpoints, const double n) |
void | helper_scale (KeyPoint *k, const std::vector< yarp::sig::Vector > &helperpoints, const double s) |
double | helper_getmaxpath (KeyPoint *k, std::vector< bool > &visited) const |
Protected Attributes | |
std::string | type |
skeleton's type ("assistive_rehab::SkeletonStd") | |
std::string | tag |
skeleton's tag | |
std::vector< KeyPoint * > | keypoints |
vector of pointer to KeyPoint | |
std::unordered_map< std::string, KeyPoint * > | tag2key |
map associating a tag to a pointer to a KeyPoint | |
std::unordered_map< KeyPoint *, unsigned int > | key2id |
map associating a pointer to a KeyPoint to an index | |
yarp::sig::Matrix | T |
transformation matrix | |
yarp::sig::Vector | coronal |
vector containing the normal to the coronal plane | |
yarp::sig::Vector | sagittal |
vector containing the normal to the sagittal plane | |
yarp::sig::Vector | transverse |
vector containing the normal to the transverse plane | |
Basic class for skeleton standard.
Definition at line 528 of file skeleton.h.
|
virtualinherited |
Import the skeleton structure from its properties.
prop | Property object containing the properties of a skeleton. |
Available properties are:
Definition at line 400 of file skeleton.cpp.
References assistive_rehab::Skeleton::coronal, assistive_rehab::Skeleton::key2id, assistive_rehab::Skeleton::keypoints, assistive_rehab::Skeleton::sagittal, assistive_rehab::Skeleton::T, assistive_rehab::Skeleton::tag, assistive_rehab::Skeleton::tag2key, and assistive_rehab::Skeleton::transverse.
|
virtualinherited |
Retrieve the ordered list of keypoints.
Definition at line 581 of file skeleton.cpp.
References assistive_rehab::KeyPoint::getPoint(), and assistive_rehab::Skeleton::keypoints.
|
virtualinherited |
Retrieve the ordered list of keypoints.
Definition at line 597 of file skeleton.cpp.
References assistive_rehab::KeyPoint::getPixel(), assistive_rehab::KeyPoint::getPoint(), and assistive_rehab::Skeleton::keypoints.
|
virtualinherited |
Retrieve the unordered list of keypoints.
Definition at line 589 of file skeleton.cpp.
References assistive_rehab::Skeleton::tag2key.
|
virtualinherited |
Retrieve the unordered list of keypoints.
Definition at line 605 of file skeleton.cpp.
References assistive_rehab::Skeleton::tag2key.
|
inherited |
Retrieve the coronal plane of the skeleton.
Definition at line 340 of file skeleton.cpp.
References assistive_rehab::Skeleton::coronal.
|
inherited |
Retrieve the skeleton's maximum path.
Definition at line 355 of file skeleton.cpp.
References assistive_rehab::Skeleton::getNumKeyPoints(), and assistive_rehab::Skeleton::keypoints.
|
inherited |
Retrieve the index of the keypoint from its tag.
tag | string containing the keypoint's tag. |
Definition at line 431 of file skeleton.cpp.
References assistive_rehab::Skeleton::key2id, assistive_rehab::Skeleton::tag, and assistive_rehab::Skeleton::tag2key.
|
inlineinherited |
Retrieve the number of keypoints of the skeleton.
Definition at line 383 of file skeleton.h.
References assistive_rehab::Skeleton::keypoints.
Referenced by assistive_rehab::Skeleton::getMaxPath().
|
inherited |
Retrieve the sagittal plane of the skeleton.
Definition at line 345 of file skeleton.cpp.
References assistive_rehab::Skeleton::sagittal.
|
inlineinherited |
Return a reference to the tag of the skeleton.
Definition at line 278 of file skeleton.h.
References assistive_rehab::Skeleton::tag.
|
inlineinherited |
Retrieve the transformation matrix of the skeleton.
Definition at line 291 of file skeleton.h.
References assistive_rehab::Skeleton::T.
|
inherited |
Retrieve the transverse plane of the skeleton.
Definition at line 350 of file skeleton.cpp.
References assistive_rehab::Skeleton::transverse.
|
inlineinherited |
Return a reference to the type of the skeleton.
Definition at line 266 of file skeleton.h.
References assistive_rehab::Skeleton::type.
|
inherited |
Normalize skeleton in order to have unitary/desired distance among keypoints.
n | double containing the normalization factor. |
Definition at line 613 of file skeleton.cpp.
References assistive_rehab::KeyPoint::getPoint(), and assistive_rehab::Skeleton::keypoints.
|
inherited |
Keypoint access.
Returns a pointer to the keypoint specified by its tag.
tag | string containing the keypoint's tag. |
|
inherited |
Keypoint access.
Returns a pointer to the keypoint specified by its index.
i | int containing the keypoint's index. |
Definition at line 449 of file skeleton.cpp.
References assistive_rehab::Skeleton::keypoints.
|
inherited |
Rescale skeleton.
s | double containing the scaling factor. |
Definition at line 624 of file skeleton.cpp.
References assistive_rehab::KeyPoint::getPoint(), and assistive_rehab::Skeleton::keypoints.
|
inherited |
Set a new coronal plane to the skeleton.
coronal | vector containing the x,y,z coordinates of the normal to the desired plane. |
Definition at line 307 of file skeleton.cpp.
References assistive_rehab::Skeleton::coronal.
|
inherited |
Set a new sagittal plane to the skeleton.
sagittal | vector containing the x,y,z coordinates of the normal to the desired plane. |
Definition at line 318 of file skeleton.cpp.
References assistive_rehab::Skeleton::sagittal.
|
inlineinherited |
Set the tag of the skeleton.
tag | string containing the desired tag. |
Definition at line 272 of file skeleton.h.
References assistive_rehab::Skeleton::tag.
|
inherited |
Set a new transformation matrix of the skeleton.
T | matrix containing the desired transformation. |
Definition at line 296 of file skeleton.cpp.
References assistive_rehab::Skeleton::T.
|
inherited |
Set a new transverse plane to the skeleton.
transverse | vector containing the x,y,z coordinates of the normal to the desired plane. |
Definition at line 329 of file skeleton.cpp.
References assistive_rehab::Skeleton::transverse.
|
virtualinherited |
Export the skeleton structure as a property.
Available properties are:
Definition at line 366 of file skeleton.cpp.
References assistive_rehab::Skeleton::coronal, assistive_rehab::Skeleton::keypoints, assistive_rehab::Skeleton::sagittal, assistive_rehab::Skeleton::T, assistive_rehab::Skeleton::tag, assistive_rehab::Skeleton::transverse, and assistive_rehab::Skeleton::type.
|
virtualinherited |
Update skeleton from unordered list.
unordered | vector containing an unordered list of keypoints. The single keypoint is specified as pair which associates a string, containing the keypoint's tag, and a vector, containing the x,y,z coordinates. |
|
virtualinherited |
Update skeleton from ordered list.
ordered | vector containing the ordered list of keypoints. The single keypoint is specified as vector containing the x,y,z coordinates. |
|
virtualinherited |
Update skeleton from properties.
prop | a Property object containing skeleton information. |
Available properties are:
|
overridevirtual |
Update skeleton planes.
Implements assistive_rehab::Skeleton.
Definition at line 767 of file skeleton.cpp.
References assistive_rehab::Skeleton::coronal, assistive_rehab::Skeleton::sagittal, assistive_rehab::Skeleton::tag2key, and assistive_rehab::Skeleton::transverse.
|
virtualinherited |
Update skeleton from unordered list.
unordered | vector containing an unordered list of keypoints. The single keypoint is specified as pair that associates a string containing the keypoint's tag to a pair of vectors contianing x,y,z and u,v coordinates. |
|
virtualinherited |
Update skeleton from ordered list.
ordered | vector containing the ordered list of keypoints. The single keypoint is specified as a pair of a vector containing the x,y,z camera coordinates and a vector containing the u,v image coordinates. |