예제 #1
0
    def __init__(self,
                 size,
                 tag_length,
                 tag_spacing,
                 start_id=0,
                 tag_family='t36h11',
                 border_bits=2,
                 min_rows=2,
                 min_points=12,
                 subpix_region=5,
                 adjusted_points=None):

        assert tag_family in self.aruco_dicts
        assert tag_family == 't36h11', "apriltags2-ethz currently supports only t36h11, remove this once complete!"

        self.size = tuple(size)

        self.start_id = start_id
        self.tag_family = tag_family
        self.tag_spacing = tag_spacing
        self.tag_length = tag_length
        self.border_bits = int(border_bits)

        self.adjusted_points = choose(adjusted_points, self.points)

        self.min_rows = min_rows
        self.min_points = min_points
        self.subpix_region = subpix_region
예제 #2
0
def align_transforms_robust(m1, m2, valid=None, threshold=1.5):
    """ As align_transforms, with outlier rejection.
    threshold (float): factor of upper quartile to be determined as an outlier.
  """

    mask = choose(valid, np.ones(m1.shape[0], dtype=np.bool))

    m = align_transforms_mean(m1[mask], m2[mask])
    errs = error_transform(m, m1, m2)

    inliers = test_outlier(errs, threshold) & mask
    m = align_transforms_mean(m1[inliers], m2[inliers])

    return m, inliers
예제 #3
0
  def __init__(self, size, tag_length, 
      tag_spacing, tag_family='t36h11', border_bits=2, min_rows=2, min_points=12, subpix_region=5, adjusted_points=None):
    
    assert tag_family in self.aruco_dicts
    self.size = tuple(size)

    self.tag_family = tag_family
    self.tag_spacing = tag_spacing
    self.tag_length = tag_length
    self.border_bits = int(border_bits)

    self.adjusted_points = choose(adjusted_points, self.points) 
 
    self.min_rows = min_rows
    self.min_points = min_points
    self.subpix_region = subpix_region
예제 #4
0
    def __init__(self,
                 size,
                 square_length,
                 marker_length,
                 min_rows=3,
                 min_points=20,
                 adjusted_points=None,
                 aruco_params=None,
                 aruco_dict='4X4_100',
                 aruco_offset=0):

        self.aruco_dict = aruco_dict
        self.aruco_offset = aruco_offset

        self.size = tuple(size)

        self.marker_length = marker_length
        self.square_length = square_length

        self.adjusted_points = choose(adjusted_points, self.points)

        self.aruco_params = aruco_params or {}
        self.min_rows = min_rows
        self.min_points = min_points
예제 #5
0
 def inliers(self):
     return choose(self.inlier_mask, self.valid)
예제 #6
0
 def reprojection_inliers(self):
     inlier_table = self.point_table._extend(
         valid=choose(self.inliers, self.valid))
     return tables.valid_reprojection_error(self.reprojected, inlier_table)