#!/usr/bin/env python
# vim: set fenc=utf-8 et sts=4 ft=python :
PACKAGE = "linemod_detector"

from dynamic_reconfigure.parameter_generator_catkin import double_t, int_t, bool_t
from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator

gen = ParameterGenerator()

gen.add("rectify_patch", bool_t, 0, "rectify patch to ground plane before detecting", True)

gen.add("mask_dilation_iterations", int_t, 0, "dilate mask before detection", 2, 0, 5)

gen.add("do_median_blur", bool_t, 0, "Median blur patches", False)
gen.add("median_blur_size", int_t, 0, "Median blur kernel size", 13, 3, 29)
gen.add("pub_threshold", double_t, 0, "Match Score to publish", 90, 0, 100)
gen.add("matching_threshold", double_t, 0, "Match Score to draw any response", 80, 0, 100)
gen.add("target_width", double_t, 0, "Image width to resize patches to", 130, 0, 400)

gen.add("weak_threshold", double_t, 0, "Threshold for extracting gradients", 100, 0, 255)
gen.add("grayscale", bool_t, 0, "Convert image to gray before matching", False)

gen.add("check_color_model", bool_t, 0,
    "Check color model after linemod match", False)
gen.add("min_color_saturation", int_t, 0, "Minimum Saturation to Count Hue", 150, 0, 255)
gen.add("high_saturation_limit", double_t, 0,
    "saturation score limit for hue objects", 0.5 , 0, 1.0)
gen.add("low_saturation_limit", double_t, 0,
    "saturation limit for value objects", 0.1, 0, 1.0)
gen.add("min_inner_outer_distance", double_t, 0,
    "Minimum color model distance background/foreground", 0.5, 0.0, 1.0)
gen.add("max_exemplar_distance", double_t, 0,
    "Maximum color model distance to an exemplar", 0.3, 0.0, 1.0)

gen.add("compute_grip_angle", bool_t, 0, "Compute grip angle in named point message", False)

gen.add("debug_font_scale", double_t, 0, "Scale font for debug_image", 1.0, 0, 3.0)

exit(gen.generate(PACKAGE, "linemod_detector", "Linemod"))
