예제 #1
0
    def _set_coordinate_system(self, origin_marker_id):
        self.marker_id_to_extrinsics = {
            origin_marker_id: utils.get_marker_extrinsics_origin()
        }
        self.marker_id_to_points_3d = {
            origin_marker_id: utils.get_marker_points_3d_origin()
        }
        self.origin_marker_id = origin_marker_id

        logger.info(
            "The marker with id {} is defined as the origin of the coordinate "
            "system".format(origin_marker_id))
예제 #2
0
def _calculate(data_for_triangulation):
    marker_points_3d = _run_triangulation(data_for_triangulation)

    rotation_matrix, translation, error = utils.svdt(
        A=utils.get_marker_points_3d_origin(), B=marker_points_3d)

    if _check_result_reasonable(translation, error):
        rotation = cv2.Rodrigues(rotation_matrix)[0]
        marker_extrinsics = utils.merge_extrinsics(rotation, translation)
        return marker_extrinsics
    else:
        return None
예제 #3
0
    def _set_coordinate_system(self, origin_marker_id):
        self.marker_id_to_extrinsics = {
            origin_marker_id: utils.get_marker_extrinsics_origin()
        }
        self.marker_id_to_points_3d = {
            origin_marker_id: utils.get_marker_points_3d_origin()
        }
        self.origin_marker_id = origin_marker_id

        logger.info(
            "The marker with id {} is defined as the origin of the coordinate "
            "system".format(origin_marker_id)
        )
예제 #4
0
def _calculate(data_for_triangulation):
    marker_points_3d = _run_triangulation(data_for_triangulation)

    rotation_matrix, translation, error = utils.svdt(
        A=utils.get_marker_points_3d_origin(), B=marker_points_3d
    )

    if _check_result_reasonable(translation, error):
        rotation = cv2.Rodrigues(rotation_matrix)[0]
        marker_extrinsics = utils.merge_extrinsics(rotation, translation)
        return marker_extrinsics
    else:
        return None