⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

enum ArucoDict

Predefined ArUco marker dictionaries. A dictionary describes the grid size of the markers, and how many unique marker ids it contains. The tracker can only detect markers from the dictionary it’s configured for.

Enum Values

   
Default Let StereoKit pick, currently 4x4, 50 ids.
Dict4x4_100 4x4 grid, 100 unique ids.
Dict4x4_1000 4x4 grid, 1000 unique ids.
Dict4x4_250 4x4 grid, 250 unique ids.
Dict4x4_50 4x4 grid, 50 unique ids.
Dict5x5_100 5x5 grid, 100 unique ids.
Dict5x5_1000 5x5 grid, 1000 unique ids.
Dict5x5_250 5x5 grid, 250 unique ids.
Dict5x5_50 5x5 grid, 50 unique ids.
Dict6x6_100 6x6 grid, 100 unique ids.
Dict6x6_1000 6x6 grid, 1000 unique ids.
Dict6x6_250 6x6 grid, 250 unique ids.
Dict6x6_50 6x6 grid, 50 unique ids.
Dict7x7_100 7x7 grid, 100 unique ids.
Dict7x7_1000 7x7 grid, 1000 unique ids.
Dict7x7_250 7x7 grid, 250 unique ids.
Dict7x7_50 7x7 grid, 50 unique ids.

Examples

Finding an ArUco marker by id

The dictionary must match the markers you printed, or they won’t be detected. AprilTags work the same way, via AprilTagDictionary.

public void StartAruco()
{
	Spatial.ArucoDictionary = ArucoDict.Dict4x4_50;
	// A 10cm printed marker, used by runtimes that support known sizes
	Spatial.SetMarkerSize(MarkerType.Aruco, 0.1f);
	// Markers taped to a wall can have their pose refined over time
	Spatial.SetMarkerStationary(MarkerType.Aruco, true);
	Spatial.Request(SpatialCapability.Aruco);
}

static bool FindMarker(uint id, out Pose pose)
{
	foreach (SpatialEntity marker in SpatialEntity.With(SpatialComponent.Marker))
	{
		if (marker.TryGetMarker(out MarkerType type, out uint markerId) && type == MarkerType.Aruco && markerId == id)
			return marker.TryGetBounds2D(out pose, out _);
	}
	pose = Pose.Identity;
	return false;
}




Found an issue with these docs, or have some additional questions? Create an Issue on Github!