diff options
-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(): |