#!/usr/bin/env python 
PACKAGE = "vision_temp"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

buoy_algorithm_enum = gen.enum([ gen.const("GrayContours", int_t, 1, "Blob detect with contours algorithm"),
                                 gen.const("HSVThreshold", int_t, 2, "HSVThresholding"),
                                 gen.const("SatThreshold", int_t, 3, "Sat Adaptive Thresholding")],
                                 "Enum for different buoy detection algorithms")

gen.add("buoy_detection", int_t, 0, "Change buoy detection algorithm", 3, 1, 3, edit_method=buoy_algorithm_enum)

gen.add("red_high_upper",int_t,0,'red high upper thres',0,0,180)
gen.add("red_high_lower",int_t,0,'red high lower thres',0,0,180)
gen.add("red_low_upper",int_t,0,'red low upper thres',12,0,180)
gen.add("red_low_lower",int_t,0,'red low lower thres',2,0,180)
gen.add("yellow_upper",int_t,0,'yellow upper thres',40,0,180)
gen.add("yellow_lower",int_t,0,'yellow lower thres',20,0,180)
gen.add("green_upper",int_t,0,'green upper thres',72,0,180)
gen.add("green_lower",int_t,0,'green lower thres',65,0,180)



gen.add("ad_size", int_t, 0, "adaptive threshold window size",45,1,1000)
gen.add("ad_guassian", int_t, 0, "guassian or mean",1,0,1)
gen.add("erosion_size", int_t, 0, "erode filter size", 3, 0,100)
gen.add("dilation_size", int_t, 0, "dilation filter size", 3, 0,100)
gen.add("erosion_iterations", int_t, 0, "erosion iterations", 2, 0,10)
gen.add("dilation_iterations", int_t, 0, "dilation iterations", 3, 0,10)

gen.add("min_area", int_t, 0, "min contour area",0,0,5000)
gen.add("max_length", int_t, 0, "max cotour points",1000,1,5000)
gen.add("circularity_min", double_t, 0, "contour min circularity",0.2,0,1)
gen.add("aspect_ratio_diff", double_t, 0, "aspect ratio minus 1",1,0,1)

exit(gen.generate(PACKAGE, "vision_temp", "VisionBridge"))