skbot.transform.FrustumProjection

class skbot.transform.FrustumProjection(hfov, image_shape)[source]

Frustum based intrinsic camera transformation.

This link computes the 2D camera/pixel position of a point in 3D (world) space. The projection’s center point is located in the origin and the camera is pointing along the positive z-axis. The origin of the pixel frame is located at the top left corner of the image with the y-axis pointing down and the x-axis pointing right. Points along the z-axis are projected into the center of the image (image_shape/2).

Parameters
hfovfloat

The angle of the viewing frustum in radians. It is assumed to be less than pi (180°).

image_shapeArrayLike

The shape (height, width) of the image plane in pixels.

Notes

This function assumes that hfov is less than pi (180°).

Points outside the viewing frustum will still be projected. While most will be mapped into points outside of image_shape, points on the backside of the camera may alias with points inside the image. In this case special care must be taken.

Method Summary

__call__(parent[, child, add_inverse])

Add this link to the parent frame.

invert()

Returns a new link that is the inverse of this link.

transform(x)

Expresses the vector x (assumed to be given in the parent's frame) in the child's frame.

__inverse_transform__(x)

Transform x (given in the child frame) into the parent frame.

Methods

__call__(parent, child=None, *, add_inverse=True)

Add this link to the parent frame.

Parameters
parentFrame

The Frame from which vectors originate.

childFrame

The Frame in which vectors are expressed after they were mapped by this link’s transform. If None, a new child will be created.

add_inversebool

Also add the inverse link to the child if this Link is invertible. Defaults to True.

Returns
childFrame

The Frame in which vectors are expressed after they were mapped by this link’s transform.

Return type

Frame

invert()

Returns a new link that is the inverse of this link.

The links share parameters, i.e., if the transform of a link changes, the transform of its inverse does also.

Return type

Frame

transform(x)[source]

Expresses the vector x (assumed to be given in the parent’s frame) in the child’s frame.

Parameters
xArrayLike

The vector expressed in the parent’s frame

Returns
yArrayLike

The vector expressed in the child’s frame

Return type

ndarray

__inverse_transform__(x)

Transform x (given in the child frame) into the parent frame.

Parameters
xArrayLike

The vector expressed in the childs’s frame

Returns
yArrayLike

The vector expressed in the parents’s frame

Return type

ndarray