fluidimage.calibration.calib2d_simple#

Simple 2D calibration#

class fluidimage.calibration.calib2d_simple.Calibration2DSimple(point0, point1, distance, aspect_ratio_pixel=1.0, shape_image=None, path_image=None, point_origin=(0, 0), orig_phys=(0.0, 0.0))[source]#

Bases: object

Simple 2D calibration

The hypothesis are (at least):

  • No rotation (x and y remains x and y).

  • No optical aberration.

  • Everything orthogonal (the camera points directly toward the laser plan).

Parameters:
point0: sequence of size 2

The coordinates in pixel of a first point as (indy, indx).

point1: sequence of size 2

The coordinates in pixel of a first point as (indy, indx).

distance: number

The distance between the 2 points in physical unit.

aspect_ratio_pixel: number

The aspect ratio of 1 pixel (a characteristic of the camera) as yphys1pxel/xphys1pxel.

shape_image: sequence of size 2 (optional)

The shape of the image. If it is not given, the next argument (path_image) is used.

path_image: str (optional)

The path toward the image (used to get the shape of the image).

point_reference: sequence of size 2 (optional, default=(0, 0))

A point for which (yphys, xphys) = orig_phys

orig_phys: sequence of size 2 (optional, default=(0., 0.))

The coordinates in physical unit of the point origin.

pix2phys(ixs, iys)[source]#

Calcul physical coordinates from indices.

Parameters:
ixs: number or np.array

Indices in the x direction (second dimension).

iys: number or np.array

Indices in the y direction (first dimension).

displ2phys(ixs, iys, displxs, displys)[source]#

Calcul physical coordinates and physical displacements from indices.

Parameters:
ixs: number or np.array

Indices in the x direction (second dimension).

iys: number or np.array

Indices in the y direction (first dimension).

displxs: number or np.array

Displacements in the x direction (in pixels)

displys: number or np.array

Displacements in the y direction (in pixels)

Classes

Calibration2DSimple(point0, point1, distance)

Simple 2D calibration