ShapeBased

class eyefeatures.preprocessing.aoi_extraction.ShapeBased(x=None, y=None, shapes=None, aoi_name='AOI', pk=None)[source]

Bases: BaseAOIPreprocessor

Defines AOI using the specified shapes.

Parameters:
  • x (str) – x coordinate of fixation.

  • y (str) – y coordinate of fixation.

  • aoi_name (str) – name of AOI column.

  • pk (list[str]) – list of column names used to split pd.DataFrame.

  • shapes (list) –

    list of shapes (list of tuple lists). Parameters for shape:

    0: ‘r’, ‘c’, ‘e’: rectangle, circle, ellipse

    For the rectangle:

    1: coordinates of the lower left corner of the rectangle.

    2: coordinates of the upper right corner of the rectangle.

    For the circle:

    1: coordinates of the center of the circle.

    2: radius of the circle.

    For the ellipse:

    \(\frac{((x - x')\cos(\alpha) + (y - y')\sin(\alpha))^2}{a^2}\) \(+ \frac{(-(x - x')\sin(\alpha) + (y - y')\cos(\alpha))^2}{b^2} = c\)

    1: coordinates of the center of the ellipse \((x', y')\).

    2: “a” in the ellipse equation

    3: “b” in the ellipse equation

    4: “c” in the ellipse equation

    5: angle of inclination of th ellipse in radians (\(\alpha\))