aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-09-13 08:29:15 +0200
committerThéo de la Hogue2022-09-13 08:29:15 +0200
commitbec0f12c5a99ca0e7c8049adb91d0da6b05d76ac (patch)
treed8bf24e046080734eedc9ea3401720bbbcf60009 /src
parent90cae9444b0e0d7f2bf8760394671ddb0c739c52 (diff)
downloadargaze-bec0f12c5a99ca0e7c8049adb91d0da6b05d76ac.zip
argaze-bec0f12c5a99ca0e7c8049adb91d0da6b05d76ac.tar.gz
argaze-bec0f12c5a99ca0e7c8049adb91d0da6b05d76ac.tar.bz2
argaze-bec0f12c5a99ca0e7c8049adb91d0da6b05d76ac.tar.xz
Replacing asarray by array
Diffstat (limited to 'src')
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoCamera.py4
-rw-r--r--src/argaze/AreaOfInterest/AOI3DScene.py6
-rw-r--r--src/argaze/utils/export_tobii_segment_aruco_visual_scan.py4
-rw-r--r--src/argaze/utils/live_tobii_aruco_aoi_ivy_application.py6
-rw-r--r--src/argaze/utils/live_tobii_aruco_aoi_ivy_controller.py2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py
index 6aa602c..116f6a2 100644
--- a/src/argaze/ArUcoMarkers/ArUcoCamera.py
+++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py
@@ -36,8 +36,8 @@ class ArUcoCamera():
self.__rms = calibration_data['rms']
self.__dimensions = calibration_data['dimensions']
- self.__K = numpy.asarray(calibration_data['camera matrix'])
- self.__D = numpy.asarray(calibration_data['distortion coefficients'])
+ self.__K = numpy.array(calibration_data['camera matrix'])
+ self.__D = numpy.array(calibration_data['distortion coefficients'])
def save_calibration_file(self, camera_calibration_filepath):
"""Save optical parameters into .json file."""
diff --git a/src/argaze/AreaOfInterest/AOI3DScene.py b/src/argaze/AreaOfInterest/AOI3DScene.py
index ca59024..aa7e27f 100644
--- a/src/argaze/AreaOfInterest/AOI3DScene.py
+++ b/src/argaze/AreaOfInterest/AOI3DScene.py
@@ -11,14 +11,14 @@ import numpy
import cv2 as cv
# Define a zero distorsion matrix
-D0 = numpy.asarray([0.0, 0.0, 0.0, 0.0, 0.0])
+D0 = numpy.array([0.0, 0.0, 0.0, 0.0, 0.0])
@dataclass
class AOI3DScene(AOIFeatures.AOIScene):
"""Define AOI 3D scene."""
- rotation: list = field(init=False, default=numpy.asarray([0., 0., 0.]))
- translation: list = field(init=False, default=numpy.asarray([0., 0., 0.]))
+ rotation: list = field(init=False, default=numpy.array([0., 0., 0.]))
+ translation: list = field(init=False, default=numpy.array([0., 0., 0.]))
def __post_init__(self, **aois):
diff --git a/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py b/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
index 640c602..51fee22 100644
--- a/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
+++ b/src/argaze/utils/export_tobii_segment_aruco_visual_scan.py
@@ -149,11 +149,11 @@ def main():
cv.putText(aoi2D_visu_frames[marker_id], f'Segment time range: {int(args.time_range[0] * 1000)} - {int(args.time_range[1] * 1000)} ms', (20, 40), cv.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 1, cv.LINE_AA)
# Project 3D scene onto the visualisation plan
- aoi3D_scenes[marker_id].rotation = numpy.asarray([[-numpy.pi, 0.0, 0.0]])
+ aoi3D_scenes[marker_id].rotation = numpy.array([[-numpy.pi, 0.0, 0.0]])
aoi3D_scenes[marker_id].translation = aoi3D_scenes[marker_id].center()*[-1, 1, 0] + [0, 0, scene_height]
# Edit a projection matrix for the reference frame
- K0 = numpy.asarray([[visu_height, 0.0, visu_width/2], [0.0, visu_height, visu_height/2], [0.0, 0.0, 1.0]])
+ K0 = numpy.array([[visu_height, 0.0, visu_width/2], [0.0, visu_height, visu_height/2], [0.0, 0.0, 1.0]])
aoi2D_visu_scenes[marker_id] = aoi3D_scenes[marker_id].project(K0)
diff --git a/src/argaze/utils/live_tobii_aruco_aoi_ivy_application.py b/src/argaze/utils/live_tobii_aruco_aoi_ivy_application.py
index 3b3b8e0..6ae7782 100644
--- a/src/argaze/utils/live_tobii_aruco_aoi_ivy_application.py
+++ b/src/argaze/utils/live_tobii_aruco_aoi_ivy_application.py
@@ -58,11 +58,11 @@ def main():
ref_aoi = 'Scene_Plan'
# TODO: pass the reference AOI in argument
- aoi3D_scene.rotation = numpy.asarray([[-numpy.pi, 0.0, 0.0]])
- aoi3D_scene.translation = numpy.asarray([[19.0, 8.0, 25.0]])
+ aoi3D_scene.rotation = numpy.array([[-numpy.pi, 0.0, 0.0]])
+ aoi3D_scene.translation = numpy.array([[19.0, 8.0, 25.0]])
# Edit a projection matrix for the reference frame
- K0 = numpy.asarray([[visu_ratio, 0.0, visu_width/2], [0.0, visu_ratio, visu_height/2], [0.0, 0.0, 1.0]])
+ K0 = numpy.array([[visu_ratio, 0.0, visu_width/2], [0.0, visu_ratio, visu_height/2], [0.0, 0.0, 1.0]])
aoi2D_visu_scene = aoi3D_scene.project(K0)
diff --git a/src/argaze/utils/live_tobii_aruco_aoi_ivy_controller.py b/src/argaze/utils/live_tobii_aruco_aoi_ivy_controller.py
index 654a46d..6db1de4 100644
--- a/src/argaze/utils/live_tobii_aruco_aoi_ivy_controller.py
+++ b/src/argaze/utils/live_tobii_aruco_aoi_ivy_controller.py
@@ -172,7 +172,7 @@ def main():
aoi3D_scene = aoi3D_scene.clip(300, 150, cone_tip=[0., 0., -20.])
# Edit Zero distorsion matrix
- D0 = numpy.asarray([0.0, 0.0, 0.0, 0.0, 0.0])
+ D0 = numpy.array([0.0, 0.0, 0.0, 0.0, 0.0])
# DON'T APPLY CAMERA DISTORSION : it projects points which are far from the frame into it
# This hack isn't realistic but as the gaze will mainly focus on centered AOI, where the distorsion is low, it is acceptable.