Imager¶
-
class
imager.
Imager
(name, center, radius, position, rot, trans, longitude=None, latitude=None, elevation=None)[source]¶ Describes an imager and all the parameters related to it. Contains the methods dealing with lens distortions and mis-alignment correction.
-
name
¶ str – Name of the imager
-
center
¶ list[int] – List of two ints describing the center of the fish-eye lens in the captured pictures
-
radius
¶ int – The radius of the circle created by the fish-eye lens
-
position
¶ numpy.array – The coordinates of the relative position of the imager in real world coordinates (meters)
-
rot
¶ numpy.array – A rotation matrix (3x3) to cope with the misalignement of the image
-
trans
¶ numpy.array – A translation matrix (3x1) to cope with the misalignement of the image
-
longitude
¶ str – The longitude coordinate of the imager (optional, only needed for segmentation)
-
latitude
¶ str – The latitude coordinate of the imager (optional, only needed for segmentation)
-
elevation
¶ int – The elevation of the integer in meters (optional, only needed for segmentation)
-
cam2world
(m)[source]¶ Returns the 3D coordinates with unit length corresponding to the pixels locations on the image.
Parameters: m (numpy.array) – 2 x m matrix containing m pixel coordinates Returns: 3 x m matrix of the corresponding unit sphere vectors Return type: numpy.array
-
undistort_image
(image, sizeResult=[1000, 1000], altitude=500, bearing=0, elevation=0, pixelWidth=1)[source]¶ Undistort a fish-eye image to a standard camera image by a ray-tracing approach.
Parameters: - image (numpy.array) – the fish-eye image to undistort
- sizeResult (list[int]) – 2D size of the output undistorted image [pixels]
- altitude (int) – the altitude of the virtual image plane to form the undistorted image [meters]
- bearing (float) – the bearing angle of the undistorted plane (in degrees)
- elevation (float) – the elevation angle of the undistorted plane (in degrees)
- pixelWidth (int) – the width in real world coordinates of one pixel of the undistorted image [meters]
-