Skip to content

Internal matching result

InternalMatchingResult

Bases: SharedMatchingResult

Representation of the matching result, designed to be used by the child process only.

Source code in src/officialeye/_internal/template/internal_matching_result.py
class InternalMatchingResult(SharedMatchingResult):
    """
    Representation of the matching result, designed to be used by the child process only.
    """

    def __init__(self, template: InternalTemplate, /):
        super().__init__(template)

        self._template_id = template.identifier

        # keys: keypoint ids
        # values: matches with this keypoint
        self._matches_dict: Dict[str, List[IMatch]] = {}

        for keypoint in self.template.keypoints:
            self._matches_dict[keypoint.identifier] = []

    @property
    def template(self) -> InternalTemplate:
        return get_internal_context().get_template(self._template_id)