Processors for keypoints
ChangeKeypointsCoordinateSystem
paz.processors.keypoints.ChangeKeypointsCoordinateSystem()
Changes keypoints
2D coordinate system using box2D
coordinates
to locate the new origin at the openCV image origin (top-left).
DenormalizeKeypoints
paz.processors.keypoints.DenormalizeKeypoints()
Transform normalized keypoints coordinates into image-size coordinates.
Arguments
- image_size: List of two floats having height and width of image.
NormalizeKeypoints
paz.processors.keypoints.NormalizeKeypoints(image_size)
Transform keypoints in image-size coordinates to normalized coordinates.
Arguments
- image_size: List of two ints indicating ''(height, width)''
PartitionKeypoints
paz.processors.keypoints.PartitionKeypoints()
Partitions keypoints from shape [num_keypoints, 2] into a list of the form ((2), (2), ....) and length equal to num_of_keypoints.
ProjectKeypoints
paz.processors.keypoints.ProjectKeypoints(projector, keypoints)
Projects homogenous keypoints (4D) in the camera coordinates system into image coordinates using a projective transformation.
Arguments
- projector: Instance of ''paz.models.Project''.
- keypoints: Numpy array of shape ''(num_keypoints, 3)''
RemoveKeypointsDepth
paz.processors.keypoints.RemoveKeypointsDepth()
Removes Z component from keypoints.
TranslateKeypoints
paz.processors.keypoints.TranslateKeypoints()
Applies a translation to keypoints. The translation is a list of length two indicating the x, y values.
DenormalizeKeypoints2D
paz.processors.keypoints.DenormalizeKeypoints2D()
Transform normalized keypoints coordinates into image-size coordinates.
Arguments
- image_size: List of two floats having height and width of image.
NormalizeKeypoints2D
paz.processors.keypoints.NormalizeKeypoints2D(image_size)
Transform keypoints in image-size coordinates to normalized coordinates.
Arguments
- image_size: List of two ints indicating ''(height, width)''
ArgumentsToImageKeypoints2D
paz.processors.keypoints.ArgumentsToImageKeypoints2D()
Convert array arguments into UV coordinates.
Image plane
(0,0)--------> (U) | | | v
(V)
Arguments
- row_args: Array (num_rows).
- col_args: Array (num_cols).
Returns
Array (num_cols, num_rows) representing points2D in UV space.
Notes
Arguments are row args (V) and col args (U). Image points are in UV coordinates; thus, we concatenate them in that order i.e. [col_args, row_args]
ScaleKeypoints
paz.processors.keypoints.ScaleKeypoints(scale=1, shape=(128, 128))
Scale keypoints to input image shape.
Arguments
- keypoints: Array. Detected keypoints by the model
- image: Array. Input image.
Returns
Scaled keypoints: Array. keypoints scaled to input image shape.
ComputeOrientationVector
paz.processors.keypoints.ComputeOrientationVector(parents)
Calculate the orientation of keypoints links with 3D keypoints.
Arguments
- keypoints: Array. 3D keypoints
Returns
- orientation: Array. Orientation of keypoint links
MergeKeypoints2D
paz.processors.keypoints.MergeKeypoints2D(args_to_mean)
FilterKeypoints2D
paz.processors.keypoints.FilterKeypoints2D(args_to_mean, h36m_to_coco_joints2D)
StandardizeKeypoints2D
paz.processors.keypoints.StandardizeKeypoints2D(data_mean2D, data_stdev2D)
DestandardizeKeypoints2D
paz.processors.keypoints.DestandardizeKeypoints2D(data_mean3D, data_stdev3D, dim_to_use)
OptimizeHumanPose3D
paz.processors.keypoints.OptimizeHumanPose3D(args_to_joints3D, solver, camera_intrinsics)
Optimize human 3D pose
Arguments
solver: library solver camera_intrinsics: camera intrinsic parameters
Returns
keypoints3D, optimized keypoints3D