LibCapy - camera

Camera class. Assuming a left handed world coordinates system where +x/right, +y/up, +z/forward. All unit in meters.

Macros:

Enumerations:

Types of camera

Typedefs:

None.

Struct CapyCamera :

Struct CapyCamera's properties:

Type of camera (default: pinhole)

Position (center of the lens, in world coordinates system, default: 0)

Pose matrix of the camera (in world coordinates system, default: identity) Per row: right, up, front normalised vector

Right direction from the camera (in world coordinates system, reference to the pose matrix values, default: x)

Up direction from the camera (in world coordinates system, reference to the pose matrix values, default: y)

Forward direction from the camera (in world coordinates system, reference to the pose matrix values, default: z)

Focal length, the smaller the larger the field of view (default: 0.017)

Sensor resolution (pixels/meter, default: 100000)

Struct CapyCamera's methods:

Destructor

Project a 3D point in world coordinates to a 2D point in screen coordinates

Input argument(s):

in: the coordinates of the point to project
out: the result projected coordinates, can be same as 'in'

Output and side effect(s):

'out' is updated. The projection is calculated according to the type of camera

Convert screen coordinates into image coordinates

Input argument(s):

posScreen: the screen coordinates
posOrig: the position in the image corresponding to the origin of the screen
posImg: the result image coordinates

Output and side effect(s):

'posImg' is updated

Translate the camera

Input argument(s):

u: the translation vector

Output and side effect(s):

The camera position is updated

Rotate the camera

Input argument(s):

q: the quaternion equivalent to the rotation

Output and side effect(s):

The camera pose is updated

Get the length in pixel of a projected segment

Input argument(s):

posA: position of one end of the segment
posB: position of the other end of the segment

Output and side effect(s):

Return the length

Functions:

Create a CapyCamera

Output and side effect(s):

Return a CapyCamera

Allocate memory for a new CapyCamera and create it

Output and side effect(s):

Return a CapyCamera

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyCamera* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyCamera to free

2024-07-23
in LibCapy,
4 views
Copyright 2021-2024 Baillehache Pascal