pysdic.View#

The pysdic.View associates a pysdic.Camera and a pysdic.Image acquired by this camera, to project world points to the gray levels (or colors) of the image with their Jacobians.

Note

Several views can share the same camera or the same image: sharing an object shares its state (parameters of the camera, data and interpolation functions of the image).

View class#

class View(camera, image)[source]#

Bases: object

A view is constructed by a camera and an image acquired by the camera.

Several views can share the same camera (e.g. the same sensor at different times) or the same image (e.g. a split-screen setup where several virtual cameras see parts of the same image). Sharing an object shares its state: the parameters of a shared camera, or the data, ROI and interpolation functions of a shared image.

Note

The ROI of the image only restricts the zone where the image is interpolated. For a split-screen setup, use a ROI covering all the useful zones, no ROI, or two pysdic.Image objects built from the same array with different ROIs.

Important

The camera and the image of a view cannot be changed after its creation: create a new view instead. The image is immutable (see pysdic.Image), so its size always matches the sensor size of the camera. Only the parameters of the camera can be modified.

See also

  • pysdic.Camera for camera model and parameters (use view.camera.project for the geometric projection).

  • pysdic.Image for image representation and interpolation.

Parameters:
  • camera (pysdic.Camera) – The camera that acquired the image.

  • image (pysdic.Image) – The image acquired by the camera, with height and width equal to the sensor size of the camera (any number of channels).

Raises:

Instantiation#

The View class is instantiated with its constructor View(camera, image). The height and width of the image must be equal to the sensor size of the camera. The camera and the image cannot be changed after the creation of the view.

Implemented methods and attributes#

The following sections provide an overview of the attributes and methods defined in the pysdic.View class.

Attributes#

View.camera

[Get] The camera of the view (not a copy, it can be shared with other views).

View.image

[Get] The image of the view (not a copy, it can be shared with other views).

Projection to the image#

The world points are projected with pysdic.Camera.project(), then the image and its gradient are evaluated at the image points. The result is a pysdic.ImageProjectionResult.

View.image_project(world_points, *[, dx, ...])

Project world points to the values (gray levels or colors) of the image, using the camera's transformations and the interpolation functions of the image.

Visualization#

View.quick_visualize([geometry, figsize, ...])

Quickly visualize the image of the view and the projection of a point cloud or a mesh with pysdic.ImagePlotter.