Module Import alias identifier ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num keyword NameLoad keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore AttributeLoad NameLoad attr If BoolOpOr CompareNotEq Call NameLoad NameLoad Num CompareNotEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Raise Call NameLoad Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body If CompareNotEq AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index Num Num body Raise Call NameLoad Str If CompareNotIn BinOpSub SubscriptLoad NameLoad Index Num Num ListLoad Num Num body Raise Call NameLoad Str If UnaryOpNot BoolOpAnd Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index Num Slice Num Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad Num Num Num body Raise Call NameLoad Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Slice Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Index Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Return ListLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Return BinOpAdd NameLoad Call NameLoad Lambda arguments args NameParam NameParam defaults BinOpAdd BinOpAdd BinOpAdd NameLoad Str Str NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Return BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMult AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpSub AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Num Return Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice AttributeLoad NameLoad attr Slice attr keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore Call AttributeLoad NameLoad attr Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Call AttributeLoad NameLoad attr TupleLoad Num Num keyword Str orelse If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore Call AttributeLoad NameLoad attr Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Call AttributeLoad NameLoad attr TupleLoad Num Num keyword Str orelse Expr Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Return AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad Call AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A numpy np base Homogeneous HomogFamilyAlignment functools reduce Affine N/A Homogeneous N/A N/A 
    Base class for all ``n``-dimensional affine transformations. Provides
    methods to break the transform down into its constituent
    scale/rotation/translation, to view the homogeneous matrix equivalent,
    and to chain this transform with other affine transformations.

    Parameters
    ----------
    h_matrix : ``(n_dims + 1, n_dims + 1)`` `ndarray`
        The homogeneous matrix of the affine transformation.
    copy : `bool`, optional
        If ``False`` avoid copying ``h_matrix`` for performance.
    skip_checks : `bool`, optional
        If ``True`` avoid sanity checks on ``h_matrix`` for performance.
     __init__ N/A N/A self h_matrix copy skip_checks N/A True False N/A N/A N/A N/A Homogeneous __init__ self h_matrix copy copy skip_checks skip_checks N/A init_identity N/A N/A cls n_dims N/A N/A N/A 
        Creates an identity matrix Affine transform.

        Parameters
        ----------
        n_dims : `int`
            The number of dimensions.

        Returns
        -------
        identity : :class:`Affine`
            The identity matrix transform.
         N/A N/A cls N/A N/A np eye N/A n_dims 1 copy False skip_checks True N/A classmethod h_matrix N/A N/A self N/A N/A N/A 
        The homogeneous matrix defining this transform.

        :type: ``(n_dims + 1, n_dims + 1)`` `ndarray`
         N/A N/A self _h_matrix N/A property _set_h_matrix N/A N/A self value copy skip_checks N/A True False N/A N/A 
        Updates the `h_matrix`, performing sanity checks.

        Parameters
        ----------
        value : `ndarray`
            The new homogeneous matrix to set
        copy : `bool`, optional
            If ``False`` do not copy the h_matrix. Useful for performance.
        skip_checks : `bool`, optional
            If ``True`` skip sanity checks on the matrix. Useful for performance.
         N/A N/A skip_checks N/A N/A shape N/A value shape N/A N/A N/A N/A len shape 2 N/A N/A shape N/A 0 N/A shape N/A 1 N/A N/A N/A ValueError You need to provide a square homogeneous matrix N/A N/A N/A self h_matrix None N/A N/A N/A N/A self n_dims N/A N/A shape N/A 0 1 N/A N/A N/A ValueError Trying to update the homogeneous matrix to a different dimension N/A N/A N/A N/A shape N/A 0 1 N/A 2 3 N/A N/A N/A ValueError Affine Transforms can only be 2D or 3D N/A N/A N/A N/A N/A np allclose N/A value N/A N/A -1 N/A -1 0 N/A N/A np allclose N/A value N/A N/A -1 -1 1 N/A N/A N/A ValueError Bottom row must be [0 0 0 1] or [0, 0, 1] N/A copy N/A N/A value N/A N/A value copy N/A N/A self _h_matrix value N/A linear_component N/A N/A self N/A N/A N/A 
        The linear component of this affine transform.

        :type: ``(n_dims, n_dims)`` `ndarray`
         N/A N/A N/A self h_matrix N/A N/A -1 N/A -1 N/A property translation_component N/A N/A self N/A N/A N/A 
        The translation component of this affine transform.

        :type: ``(n_dims,)`` `ndarray`
         N/A N/A N/A self h_matrix N/A N/A -1 N/A -1 N/A property decompose N/A N/A self N/A N/A N/A 
        Decompose this transform into discrete Affine Transforms.

        Useful for understanding the effect of a complex composite transform.

        Returns
        -------
        transforms : `list` of :map:`DiscreteAffine`
            Equivalent to this affine transform, such that::

                reduce(lambda x,y: x.chain(y), self.decompose()) == self
         rotation Rotation translation Translation scale Scale N/A N/A U S V N/A N/A N/A np linalg svd N/A self linear_component N/A rotation_2 N/A Rotation U N/A rotation_1 N/A Rotation V N/A scale N/A Scale S N/A translation N/A Translation N/A self translation_component N/A N/A rotation_1 scale rotation_2 translation N/A _transform_str N/A N/A self N/A N/A N/A 
        A string representation explaining what this affine transform does.
        Has to be implemented by base classes.

        Returns
        -------
        str : `str`
            String representation of transform.
         N/A header Affine decomposing into: N/A list_str N/A N/A N/A t _transform_str N/A t N/A N/A self decompose N/A N/A header N/A reduce N/A N/A N/A x y N/A N/A N/A N/A x y list_str N/A _apply N/A N/A self x N/A kwargs N/A N/A 
        Applies this transform to a new set of vectors.

        Parameters
        ----------
        x : ``(N, D)`` `ndarray`
            Array to apply this transform to.

        Returns
        -------
        transformed_x : ``(N, D)`` `ndarray`
            The transformed array.
         N/A N/A N/A N/A np dot x N/A N/A self linear_component T N/A self translation_component N/A n_parameters N/A N/A self N/A N/A N/A 
        ``n_dims * (n_dims + 1)`` parameters - every element of the matrix but
        the homogeneous part.

        :type: int

        Examples
        --------
        2D Affine: 6 parameters::

            [p1, p3, p5]
            [p2, p4, p6]

        3D Affine: 12 parameters::

            [p1, p4, p7, p10]
            [p2, p5, p8, p11]
            [p3, p6, p9, p12]
         N/A N/A N/A self n_dims N/A N/A self n_dims 1 N/A property _as_vector N/A N/A self N/A N/A N/A 
        Return the parameters of the transform as a 1D array. These parameters
        are parametrised as deltas from the identity warp. This does not
        include the homogeneous part of the warp. Note that it flattens using
        Fortran ordering, to stay consistent with Matlab.

        **2D**

        ========= ===========================================
        parameter definition
        ========= ===========================================
        p1        Affine parameter
        p2        Affine parameter
        p3        Affine parameter
        p4        Affine parameter
        p5        Translation in `x`
        p6        Translation in `y`
        ========= ===========================================

        3D and higher transformations follow a similar format to the 2D case.

        Returns
        -------
        params : ``(n_parameters,)`` `ndarray`
            The values that parametrise the transform.
         N/A params N/A N/A self h_matrix N/A N/A np eye N/A N/A self n_dims 1 N/A N/A N/A N/A params N/A N/A N/A self n_dims N/A ravel order F N/A _from_vector_inplace N/A N/A self p N/A N/A N/A 
        Updates this Affine in-place from the new parameters. See
        from_vector for details of the parameter format
         N/A h_matrix None N/A N/A N/A N/A p shape N/A 0 6 N/A N/A h_matrix N/A N/A np eye 3 N/A N/A h_matrix N/A N/A 2 N/A N/A N/A p reshape N/A 2 3 order F N/A N/A N/A N/A N/A p shape N/A 0 12 N/A N/A h_matrix N/A N/A np eye 4 N/A N/A h_matrix N/A N/A 3 N/A N/A N/A p reshape N/A 3 4 order F N/A N/A N/A ValueError Only 2D (6 parameters) or 3D (12 parameters) homogeneous matrices are supported. N/A N/A N/A self _set_h_matrix h_matrix copy False skip_checks True N/A composes_inplace_with N/A N/A self N/A N/A N/A 
        :class:`Affine` can swallow composition with any other :class:`Affine`.
         N/A Affine N/A property N/A AlignmentAffine N/A HomogFamilyAlignment Affine N/A N/A 
    Constructs an :class:`Affine` by finding the optimal affine transform to
    align `source` to `target`.

    Parameters
    ----------
    source : :map:`PointCloud`
        The source pointcloud instance used in the alignment
    target : :map:`PointCloud`
        The target pointcloud instance used in the alignment

    Notes
    -----
    We want to find the optimal transform M which satisfies :math:`M a = b`
    where :math:`a` and :math:`b` are the `source` and `target` homogeneous
    vectors respectively. ::

       (M a)' = b'
       a' M' = b'
       a a' M' = a b'

    `a a'` is of shape `(n_dim + 1, n_dim + 1)` and so can be inverted
    to solve for `M`.

    This approach is the analytical linear least squares solution to the
    problem at hand. It will have a solution as long as `(a a')` is
    non-singular, which generally means at least 2 corresponding points are
    required.
     __init__ N/A N/A self source target N/A N/A N/A N/A N/A HomogFamilyAlignment __init__ self source target N/A optimal_h N/A N/A self _build_alignment_h_matrix source target N/A N/A N/A Affine __init__ self optimal_h copy False skip_checks True N/A _build_alignment_h_matrix N/A N/A source target N/A N/A N/A 
        Returns the optimal alignment of `source` to `target`.

        Parameters
        ----------
        source : :map:`PointCloud`
            The source pointcloud instance used in the alignment
        target : :map:`PointCloud`
            The target pointcloud instance used in the alignment
         N/A a N/A N/A source h_points N/A b N/A N/A target h_points N/A N/A N/A N/A N/A np linalg solve N/A N/A np dot a N/A a T N/A N/A np dot a N/A b T T N/A staticmethod _set_h_matrix N/A N/A self value copy skip_checks N/A True False N/A N/A 
        Updates ``h_matrix``, optionally performing sanity checks.

        .. note::

            Updating the ``h_matrix`` on an :map:`AlignmentAffine`
            triggers a sync of the target.

        Note that it won't always be possible to manually specify the
        ``h_matrix`` through this method, specifically if changing the
        ``h_matrix`` could change the nature of the transform. See
        :attr:`h_matrix_is_mutable` for how you can discover if the
        ``h_matrix`` is allowed to be set for a given class.

        Parameters
        ----------
        value : `ndarray`
            The new homogeneous matrix to set
        copy : `bool`, optional
            If ``False`` do not copy the h_matrix. Useful for performance.
        skip_checks : `bool`, optional
            If ``True`` skip checking. Useful for performance.

        Raises
        ------
        NotImplementedError
            If :attr:`h_matrix_is_mutable` returns ``False``.
         N/A N/A N/A Affine _set_h_matrix self value copy copy skip_checks skip_checks N/A N/A N/A self _sync_target_from_state N/A _sync_state_from_target N/A N/A self N/A N/A N/A optimal_h N/A N/A self _build_alignment_h_matrix N/A self source N/A self target N/A N/A N/A Affine _set_h_matrix self optimal_h copy False skip_checks True N/A as_non_alignment N/A N/A self N/A N/A N/A 
        Returns a copy of this :map:`Affine` without its alignment nature.

        Returns
        -------
        transform : :map:`Affine`
            A version of this affine with the same transform behavior but
            without the alignment logic.
         N/A N/A Affine N/A self h_matrix skip_checks True N/A N/A DiscreteAffine N/A object N/A N/A 
    A discrete Affine transform operation (such as a :meth:`Scale`,
    :class:`Translation` or :meth:`Rotation`). Has to be invertable. Make sure
    you inherit from :class:`DiscreteAffine` first, for optimal
    `decompose()` behavior.
     decompose N/A N/A self N/A N/A N/A 
        A :class:`DiscreteAffine` is already maximally decomposed -
        return a copy of self in a `list`.

        Returns
        -------
        transform : :class:`DiscreteAffine`
            Deep copy of `self`.
         N/A N/A N/A N/A self copy N/A N/A