Exemplo n.º 1
0
    def incremental_model_builder(self, submethod, pipeline_params, args):
        feature_params = pipeline_params.get("feature", False)
        if not feature_params:
            raise RuntimeError("You must supply feature_descriptor parameters for TOD.")
        # merge it with the subtype
        feature_descriptor_params = {"feature": feature_params, "descriptor": pipeline_params.get("descriptor", {})}
        from object_recognition.tod import merge_dict

        feature_descriptor_params = merge_dict(feature_descriptor_params, submethod)

        # grab visualize if works.
        visualize = getattr(args, "visualize", False)
        return TODModelBuilder(
            json_feature_descriptor_params=dict_to_cpp_json_str(feature_descriptor_params), visualize=visualize
        )
Exemplo n.º 2
0
    def configure(self, p, _i, _o):
        feature_params = self._parameters.get("feature", False)
        if not feature_params:
            raise RuntimeError("You must supply feature_descriptor parameters for TOD.")
        # merge it with the subtype
        feature_descriptor_params = { 'feature': feature_params, 'descriptor': self._parameters.get('descriptor', {}) }
        from object_recognition.tod import merge_dict
        feature_descriptor_params = merge_dict(feature_descriptor_params, self._submethod)

        self.feature_descriptor = FeatureDescriptor(json_params=json_helper.dict_to_cpp_json_str(feature_descriptor_params))
        self.descriptor_matcher = tod_detection.DescriptorMatcher("Matcher",
                                search_json_params=json_helper.dict_to_cpp_json_str(self._parameters['search']),
                                model_documents=self._model_documents)
        self.message_cvt = ecto_ros.Mat2Image()

        guess_params = self._parameters['guess'].copy()
        guess_params['visualize'] = self._visualize
        self.guess_generator = tod_detection.GuessGenerator("Guess Gen", **guess_params)
Exemplo n.º 3
0
    def incremental_model_builder(self, submethod, pipeline_params, args):
        feature_params = pipeline_params.get("feature", False)
        if not feature_params:
            raise RuntimeError(
                "You must supply feature_descriptor parameters for TOD.")
        # merge it with the subtype
        feature_descriptor_params = {
            'feature': feature_params,
            'descriptor': pipeline_params.get('descriptor', {})
        }
        from object_recognition.tod import merge_dict
        feature_descriptor_params = merge_dict(feature_descriptor_params,
                                               submethod)

        #grab visualize if works.
        visualize = getattr(args, 'visualize', False)
        return TODModelBuilder(
            json_feature_descriptor_params=dict_to_cpp_json_str(
                feature_descriptor_params),
            visualize=visualize)