iris.nodes.geometry_refinement package

Submodules

iris.nodes.geometry_refinement.contour_interpolation module

class iris.nodes.geometry_refinement.contour_interpolation.ContourInterpolation(max_distance_between_boundary_points: float = 0.01)[source]

Bases: Algorithm

Implementation of contour interpolation algorithm conditioned by given NoiseMask.

Algorithm performs linar interpolation of points between vectorized, predicted points such that maximum distance between two consecutive points in a polygon isn’t greater than a fraction of an iris diameter length specified as max_distance_between_boundary_points parameter.

class Parameters(*, max_distance_between_boundary_points: ConstrainedFloatValue)[source]

Bases: Parameters

Parameters class for ContourInterpolation objects.

max_distance_between_boundary_points: float
run(polygons: GeometryPolygons) GeometryPolygons[source]

Refine polygons by interpolating contour points.

Parameters:

polygons (GeometryPolygons) – Polygons to refine.

Returns:

Refined polygons.

Return type:

GeometryPolygons

iris.nodes.geometry_refinement.contour_points_filter module

class iris.nodes.geometry_refinement.contour_points_filter.ContourPointNoiseEyeballDistanceFilter(min_distance_to_noise_and_eyeball: float = 0.005)[source]

Bases: Algorithm

Implementation of point filtering algorithm that removes points which are to close to eyeball or noise.

The role of this algorithm is to create a buffer around the pupil and iris polygons. This accounts for potential segmentation imprecisions, making the overall pipeline more robust against edge cases and out-of-distribution images.

The buffer width is computed relatively to the iris diameter: min_distance_to_noise_and_eyeball * iris_diameter The trigger for this buffer are the eyeball boundary and the noise (e.g. eyelashes, specular reflection, etc.).

class Parameters(*, min_distance_to_noise_and_eyeball: ConstrainedFloatValue)[source]

Bases: Parameters

Default ContourPointToNoiseEyeballDistanceFilter parameters.

min_distance_to_noise_and_eyeball: float
run(polygons: GeometryPolygons, geometry_mask: NoiseMask) GeometryPolygons[source]

Perform polygon refinement by filtering out those iris/pupil polygons points which are to close to eyeball or noise.

Parameters:
Returns:

Refined geometry polygons.

Return type:

GeometryPolygons

iris.nodes.geometry_refinement.smoothing module

class iris.nodes.geometry_refinement.smoothing.Smoothing(dphi: float = 1.0, kernel_size: float = 10.0, gap_threshold: float = 10.0)[source]

Bases: Algorithm

Implementation of contour smoothing algorithm.

Algorithm steps:
  1. Map iris/pupil points to polar space based on estimated iris/pupil centers.

  2. Smooth iris/pupil contour by applying 1D convolution with rolling median kernel approach.

  3. Map points back to cartesian space from polar space.

class Parameters(*, dphi: ConstrainedFloatValue, kernel_size: ConstrainedFloatValue, gap_threshold: ConstrainedFloatValue)[source]

Bases: Parameters

Smoothing parameters class.

dphi: float
gap_threshold: float
kernel_size: float
property kernel_offset: int

Kernel offset (distance from kernel center to border) property used when smoothing with rolling median. If a quotient is less then 1 then kernel size equal to 1 is returned.

Returns:

Kernel size.

Return type:

int

run(polygons: GeometryPolygons, eye_centers: EyeCenters) GeometryPolygons[source]

Perform smoothing refinement.

Parameters:
  • polygons (GeometryPolygons) – Contours to refine.

  • eye_centers (EyeCenters) – Eye center used when performing a coordinates mapping from cartesian space to polar space.

Returns:

Smoothed contours.

Return type:

GeometryPolygons

Module contents