GradientBased
- class eyefeatures.preprocessing.aoi_extraction.GradientBased(x=None, y=None, window_size=None, threshold=None, pk=None, aoi_name=None)[source]
Bases:
BaseAOIPreprocessorDefines the AOI for each fixation using a gradient-based algorithm. Finds the local maximum, pre-threshold it, and uses it as a center of aoi. After that, uses the Sobel operator to compute the gradient magnitude for each point. Next, defines the queue of areas of interest. Algorithm of aoi defining:
Gets the point from the queue. It is a center
Looks at the points near the center
Tries to find the point with defined aoi and maximum gradient magnitude
Adds center to this aoi
Repeats for all points in the matrix
Algorithm
Split the graph into a grid and compute density for each sector via gaussian kernel density estimation.
Pre-threshold it.
Find the local maxima. Every maximum is a center of area of interest.
Compute the gradient and magnitude.
Add all 8 points around of each maximum to the queue.
Get a point from the queue. Search among 8 points around the point with the greatest magnitude, which has AOI. Assign this label to the target point.
Add all 8 points with around the target point to the queue.
Repeat 5-8 until all points will get the AOI label.