Module PreProcessing

PreProcessing.compute_homography(r1, t_vec1, R2, t_vec2, d_inv, normal)[source]

Compute the homography from one given position to another.

Parameters:
  • r1 – rotational vector of position 1 (matrix 3*3 format)

  • t_vec1 – translation vector of position 1

  • R2 – rotational vector of position 2 (rodrigues format)

  • t_vec2 – translation vector of position 2

  • d_inv – distance to the projected plane for position 1

  • normal – normale au plan de projection

Returns:

matrix of the homography

Return type:

array

PreProcessing.compute_projection_points(video, method, transformation_3D)[source]

Design ground data in the right format as a function of the chosen method. Shift minimal position to (0,0).

Parameters:
  • video – analysed video object

  • method – type of Homography

Returns:

position of reference points on image (pixel)

Return type:

array

Returns:

position of reference points in the real word (m)

Return type:

array

PreProcessing.compute_projective_matrix(video, params)[source]

Compute projective matrix as a function of the chosen homography method.

Parameters:
  • video – analysed video object

  • method – type of Homography

  • pixels_per_metre – resolution of the transformed image

  • ROIXXX – pixel of the transformed ROI

  • angle – camera angle (from UAV position or user-defined)

  • camera_position – camera position (from UAV position or user-defined)

  • unit_gcp – converting factor for data in intrinsic matrix (default value 1000 i.e. data in mm)

Returns:

matrix of the homography

Return type:

array

PreProcessing.estimate_interior(interior_orient)[source]

Convert camera parameters of undistorted image to pixel value for opencv

Parameters:

interior_orient – intrinsic camera parameter

Returns:

intrinsic camera

Return type:

array

Returns:

distortion correction factor

Return type:

array

PreProcessing.groundProjectPoint(coord_point, rvec, tvec, camera_matrix, z=0.0)[source]

Project the points in pixel coordinate into real world coordinate. The origin is the intersection between camera axis and choosen plane.

param coord_point:

Points in pixel

param rvec:

rotational matrix from pose camera angle

param tvec:

translational vector from pose camera

param camera_matrix:

intrinsic camera matrix

return:

all points in real word coordinates

rtype:

array

PreProcessing.shift_image(video, params)[source]

Compute the translation of tranfsformed image to get positive value.

Parameters:
  • video – analysed video object

  • transformation – type of Homography

  • ROIXXX – pixel of the transformed ROI

Returns:

matrix of the translation to positive value for the transformed original image

Return type:

array

Returns:

matrix of the translation to positive value for the transformed ROI

Return type:

array

Returns:

resolution of the transformed original image

Return type:

list of int (height,width)

Returns:

resolution of the transformed ROI

Return type:

list of int (height,width)