fluidimage.calibration.calib_direct#

Direct calibration (fluidimage.calibration.calib_direct)#

class fluidimage.calibration.calib_direct.CalibDirect(glob_str_xml=None, shape_img=(None, None), path_file=None)[source]#

Bases: object

Class for direct Calibration This calibration determine the equations of optical paths for “each” pixels

Parameters:
glob_str_xml: None

Path for grid points extracted from calibration images This files are given by UVMAT. example: ‘Images/img*.xml’

nb_pixels: (None, None)

Number of pixels in the images

pth_file: None

Path of calibration file

compute_interpolents(interpolator=<class 'scipy.interpolate.interpnd.LinearNDInterpolator'>)[source]#

Compute interpolents

Create an object Interpolent (self.interp_levels) containing interpolents to switch from indices of pixels to physical coordinates.

  • indices_pixel2xphys

  • indices_pixel2yphys

  • phys2index_x_pixel

  • phys2index_y_pixel

  • zphys

There are as many interpolents of each sort as numbers of planes (z values).

compute_interpolents_pixel2line(nb_lines_x, nb_lines_y, test=False)[source]#

Compute interpolents for parameters for each optical path.

The number of optical paths is given by nb_lines_x * nb_lines_y.

Optical paths are defined with a point x0, y0, z0 and a vector dx, dy, dz.

pixel2line(indx, indy)[source]#

Compute parameters of the optical path for a pixel

An optical path is defined with a point x0, y0, z0 and a vector dx, dy, dz.

save(pth_file)[source]#

Save calibration

load(pth_file)[source]#

Load calibration

intersect_with_plane(indx, indy, a, b, c, d)[source]#

Find intersection with the line associated to the pixel indx, indy and a plane defined by ax + by + cz + d = 0

apply_calib(indx, indy, dx, dy, a, b, c, d)[source]#

Gives the projection of the real displacement projected on each camera plane and then projected on the laser plane

get_base_camera_plane(indx=None, indy=None)[source]#

Matrix of base change from camera plane to fixed plane

check_interp_levels(number=100)[source]#

Plot to check interp_levels

check_interp_lines(number=10)[source]#

Plot to check interp_lines

check_interp_lines_coeffs(number=100)[source]#

Plot to check interp_lines coefficients

class fluidimage.calibration.calib_direct.DirectStereoReconstruction(path_file0, path_file1)[source]#

Bases: object

Class to get stereo reconstruction with direct Calibration This calibration determine the equations of optical paths for “each” pixels

Parameters:
path_file0:

Path of the file of the first camera

path_file1:

Path of the file of the second camera

project2cam(indx0, indy0, dx0, dy0, indx1, indy1, dx1, dy1, a, b, c, d, check=False)[source]#

Project displacements of each cameras dx0, dy0, dx1 and dy1 in their respective planes.

find_common_grid(X0, X1, a, b, c, d)[source]#

Find a common grid for the 2 cameras

interp_on_common_grid(X0, X1, d0cam, d1cam, grid_x, grid_y)[source]#

Interpolate displacements of the 2 cameras d0cam, d1cam on the common grid grid_x, grid_y

reconstruction(X0, X1, d0cam, d1cam, a, b, c, d, grid_x, grid_y, check=False)[source]#

Reconstruction of the 3 components of the velocity in the plane defined by a, b, c, d on the grid defined by grid_x, grid_y from the displacements of the 2 cameras d0cam, d1cam in their respective planes d0cam, d1cam

Functions

get_points(points_file)

Get grid points extracted from calibration images

Classes

CalibDirect([glob_str_xml, shape_img, path_file])

Class for direct Calibration This calibration determine the equations of optical paths for "each" pixels

DirectStereoReconstruction(path_file0, ...)

Class to get stereo reconstruction with direct Calibration This calibration determine the equations of optical paths for "each" pixels

Interpolent()