Estimate scene pose

Once ArUco markers are placed into a scene and the ArUcoCamera is configured, the scene pose can be estimated.

Scene pose estimation

Add ArUcoScene to ArUcoCamera JSON configuration file

An ArUcoScene class defines a space with ArUco markers inside, helping to estimate scene pose when they are watched by ArUcoCamera.

Here is an extract from the JSON ArUcoCamera configuration file with a sample where one scene is added and displayed:

{
    "argaze.ArUcoMarker.ArUcoCamera.ArUcoCamera": {
        "name": "My FullHD camera",
        "size": [1920, 1080],
        ...
        "scenes": {
            "MyScene" : {
                "aruco_markers_group": {
                    "dictionary": "DICT_APRILTAG_16h5",
                    "places": {
                        "0": {
                            "translation": [17.5, 2.75, -0.5],
                            "rotation": [-18.5, 0, 0],
                            "size": 5
                        },
                        "1": {
                            "translation": [46, 34, 18.333],
                            "rotation": [0, 70, 0],
                            "size": 5
                        },
                        "2": {
                            "translation": [41, 4, 3.333],
                            "rotation": [-60, 0, 0],
                            "size": 5
                        }
                    }
                } 
            }
        },
        ...
        "image_parameters": {
            ...
            "draw_scenes": {
                "MyScene": {
                    "draw_aruco_markers_group": {
                        "draw_axes": {
                            "thickness": 3,
                            "length": 10
                        },
                        "draw_places": {
                            "color": [0, 0, 0],
                            "border_size": 1
                        }
                    }
                }
            }
        }
    }
}

Now, let's understand the meaning of each JSON entry.

scenes

An ArUcoCamera instance can contain multiples ArUcoScene stored by name.

MyScene

The name of an ArUcoScene. Basically, it is useful for visualization purposes.

aruco_markers_group

The 3D placement of ArUco markers into the scene, as defined in the ArUco marker description chapter. Thanks to this description, it is possible to estimate the pose of ArUcoScene in an ArUcoCamera frame.

Note

ArUcoScene pose estimation is done when calling the ArUcoCamera.watch method.

draw_scenes

The drawing parameters of each loaded ArUcoScene in an ArUcoCamera.image.