aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-29 13:45:24 +0200
committerThéo de la Hogue2023-08-29 13:45:24 +0200
commit60ac4dca5aae946cc7a8e9bb09cd7577712ecc28 (patch)
treeef5deb8ffe8b0ad53c6b2f8663e8ca26ea83d289 /src
parent60976ce27cf79f1352695133d79848cbc5b2f540 (diff)
downloadargaze-60ac4dca5aae946cc7a8e9bb09cd7577712ecc28.zip
argaze-60ac4dca5aae946cc7a8e9bb09cd7577712ecc28.tar.gz
argaze-60ac4dca5aae946cc7a8e9bb09cd7577712ecc28.tar.bz2
argaze-60ac4dca5aae946cc7a8e9bb09cd7577712ecc28.tar.xz
Moving ArFrame background attribute.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/ArFeatures.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py
index c9a6faa..b187869 100644
--- a/src/argaze/ArFeatures.py
+++ b/src/argaze/ArFeatures.py
@@ -505,24 +505,24 @@ class ArFrame():
Parameters:
name: name of the frame
size: defines the dimension of the rectangular area where gaze positions are projected.
- background: image to draw behind
gaze_movement_identifier: gaze movement identification algorithm
filter_in_progress_fixation: ignore in progress fixation
scan_path: scan path object
scan_path_analyzers: dictionary of scan path analyzers
heatmap: heatmap object
+ background: image to draw behind
layers: dictionary of AOI layers
log: enable scan path analysis logging
"""
name: str
size: tuple[int] = field(default=(1, 1))
- background: numpy.array = field(default_factory=numpy.array)
gaze_movement_identifier: GazeFeatures.GazeMovementIdentifier = field(default_factory=GazeFeatures.GazeMovementIdentifier)
filter_in_progress_fixation: bool = field(default=True)
scan_path: GazeFeatures.ScanPath = field(default_factory=GazeFeatures.ScanPath)
scan_path_analyzers: dict = field(default_factory=dict)
heatmap: AOIFeatures.Heatmap = field(default_factory=AOIFeatures.Heatmap)
+ background: numpy.array = field(default_factory=numpy.array)
layers: dict = field(default_factory=dict)
log: bool = field(default=False)
@@ -579,17 +579,6 @@ class ArFrame():
new_frame_size = (0, 0)
- # Load background image
- try:
-
- new_frame_background_value = frame_data.pop('background')
- new_frame_background = cv2.imread(os.path.join(working_directory, new_frame_background_value))
- new_frame_background = cv2.resize(new_frame_background, dsize=(new_frame_size[0], new_frame_size[1]), interpolation=cv2.INTER_CUBIC)
-
- except KeyError:
-
- new_frame_background = numpy.full((new_frame_size[1], new_frame_size[0], 3), 127).astype(numpy.uint8)
-
# Load gaze movement identifier
try:
@@ -694,6 +683,17 @@ class ArFrame():
new_heatmap_data = {}
new_heatmap = None
+ # Load background image
+ try:
+
+ new_frame_background_value = frame_data.pop('background')
+ new_frame_background = cv2.imread(os.path.join(working_directory, new_frame_background_value))
+ new_frame_background = cv2.resize(new_frame_background, dsize=(new_frame_size[0], new_frame_size[1]), interpolation=cv2.INTER_CUBIC)
+
+ except KeyError:
+
+ new_frame_background = numpy.full((new_frame_size[1], new_frame_size[0], 3), 127).astype(numpy.uint8)
+
# Load layers
new_layers = {}
@@ -731,12 +731,12 @@ class ArFrame():
# Create frame
return ArFrame(new_frame_name, \
new_frame_size, \
- new_frame_background, \
new_gaze_movement_identifier, \
filter_in_progress_fixation, \
new_scan_path, \
new_scan_path_analyzers, \
new_heatmap, \
+ new_frame_background, \
new_layers, \
new_frame_log \
)