diff options
author | Théo de la Hogue | 2023-02-15 10:38:59 +0100 |
---|---|---|
committer | Théo de la Hogue | 2023-02-15 10:38:59 +0100 |
commit | 776d40a3188a304c7db57b021095ad633c9eff77 (patch) | |
tree | 72a820bd0be460d907d8a483058be33735df26fa /src | |
parent | 21d1cea03c8323d7228908b0eb97e3b058f4ade1 (diff) | |
download | argaze-776d40a3188a304c7db57b021095ad633c9eff77.zip argaze-776d40a3188a304c7db57b021095ad633c9eff77.tar.gz argaze-776d40a3188a304c7db57b021095ad633c9eff77.tar.bz2 argaze-776d40a3188a304c7db57b021095ad633c9eff77.tar.xz |
Changing aruco_aoi dict corner field names.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/ArScene.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/argaze/ArScene.py b/src/argaze/ArScene.py index e0fa52b..1f8caba 100644 --- a/src/argaze/ArScene.py +++ b/src/argaze/ArScene.py @@ -162,10 +162,20 @@ class ArScene(): - frame height: optional, if None the height will be setup according given width and scene dimensions ratio. """ scene_size = self.aoi_scene.size + print('scene_size=', scene_size) + frame_size = numpy.array([width, scene_size[1]/scene_size[0]*width if height == 0. else height]) + print('frame_size=', frame_size) + + # Center, step back and rotate camera to get whole scene into field of view tvec = self.aoi_scene.center*[-1, 1, 0] + [0, 0, scene_size[1]] + print('tvec=', tvec) + rvec = numpy.array([[-numpy.pi, 0.0, 0.0]]) + + # Edit intrinsic camera parameter to capture whole scene K = numpy.array([[frame_size[1], 0.0, frame_size[0]/2], [0.0, frame_size[1], frame_size[1]/2], [0.0, 0.0, 1.0]]) + print('K=', K) return frame_size, tvec, rvec, K @@ -292,11 +302,11 @@ class ArScene(): # Each aoi's corner is defined by a marker's corner aoi_corners = [] - for corner in ["top_left_corner", "top_right_corner", "bottom_left_corner", "bottom_right_corner"]: + for corner in ["upper_left_corner", "upper_right_corner", "lower_left_corner", "lower_right_corner"]: aoi_corners.append(self.aruco_tracker.tracked_markers[aoi[corner]["marker_identifier"]].corners[0][aoi[corner]["marker_corner_index"]]) - aruco_aoi_scene[aruco_aoi_name] = AOIFeatures.AreaOfInterest(aoi_corners) + aruco_aoi_scene[aruco_aoi_name] = AOIFeatures.AreaOfInterest(aoi_corners).clockwise() # Then each inner aoi is projected from the current aruco aoi for inner_aoi_name, inner_aoi in self.aoi_scene.items(): |