nocs_utils
Module for utility function related to NOCS dataset.
This module contains functions to find similarity transform from NOCS maps and evaluation function for typical metrics on the NOCS datasets.
Aligning code by Srinath Sridhar
https://raw.githubusercontent.com/hughw19/NOCS_CVPR2019/master/aligning.py
Evaluation code by ... TODO
PoseEstimationError
Bases: Exception
Error if pose estimation encountered an error.
Source code in sdfest/initialization/datasets/nocs_utils.py
244 245 246 247 |
|
estimate_similarity_transform(source, target, verbose=False)
Estimate similarity transform from source to target from point correspondences.
Source and target are pairwise correponding pointsets, i.e., they include same number of points and the first point of source corresponds to the first point of target. RANSAC is used for outlier-robust estimation.
A similarity transform is estimated (i.e., isotropic scale, rotation and translation) that transforms source points onto the target points.
Note that the returned values fulfill the following equations transform @ source_points = scale * rotation_matrix @ source_points + position when ignoring homogeneous coordinate for left-hand side.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source |
ndarray
|
Source points that will be transformed, shape (N,3). |
required |
target |
ndarray
|
Target points to which source will be aligned to, shape (N,3). |
required |
verbose |
bool
|
If true additional information will be printed. |
False
|
Returns: position (np.ndarray): Translation to translate source to target, shape (3,). rotation_matrix (np.ndarray): Rotation to rotate source to target, shape (3,3). scale (float): Scaling factor along each axis, to scale source to target. transform (np.ndarray): Homogeneous transformation matrix, shape (4,4).
Source code in sdfest/initialization/datasets/nocs_utils.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|