pysdic.SDICAnalysis.compute_structure#

SDICAnalysis.compute_structure(kind)[source]#

Compute the sharing of an object between the views of the analysis.

Each distinct object (compared by identity, not by value) gets an index in the order of its first occurrence along the frames and the views. Two views with the same index share the same object: for example, the same camera at all the frames, or the same distortion for two cameras.

Note

The structures are computed once at the creation of the analysis (its views cannot change): this method returns a copy of the stored structure.

Parameters:

kind (str) – The shared object: "view", "image", "camera", "extrinsic", "distortion" or "intrinsic".

Returns:

For each frame, the index of the object of each of its views.

Return type:

List[List[int]]

Raises:

ValueError – If kind is not valid.

Examples

Two cameras observing 3 frames, with a new image per view and frame:

analysis.compute_structure("camera")  # [[0, 1], [0, 1], [0, 1]]
analysis.compute_structure("image")   # [[0, 1], [2, 3], [4, 5]]