Skip to content
Snippets Groups Projects
Commit 627101b1 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Fixed Hue dynamic reconfigure limits. Removed OpenCV dependency. Fixed filter...

Fixed Hue dynamic reconfigure limits. Removed OpenCV dependency. Fixed filter value limits calculation. Added color simulation examples.
parent 69c2872f
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ gen = ParameterGenerator()
#gen.add("velocity_scale_factor", double_t, 0, "Maximum velocity scale factor", 0.5, 0.0, 1.0)
gen.add("get_filter", bool_t, 0, "Get current filter coeficients", False)
gen.add("color_id", str_t, 0, "ID of the color", "")
gen.add("H_center", int_t, 0, "Hue window center", 90, 0, 180)
gen.add("H_center", int_t, 0, "Hue window center", 0, 0, 360)
gen.add("H_window", int_t, 0, "Hue window width", 180, 0, 180)
gen.add("S_center", int_t, 0, "Saturation window center", 128, 0, 256)
gen.add("S_window", int_t, 0, "Saturation window width", 255, 0, 256)
......
color_id: blue
H_center: 240
H_window: 10
S_center: 255
S_window: 10
V_center: 102
V_window: 10
max_area: 100000
min_area: 10
color_id: green
H_center: 120
H_window: 10
S_center: 255
S_window: 10
V_center: 102
V_window: 10
max_area: 100000
min_area: 10
color_id: red
H_center: 0
H_window: 10
S_center: 255
S_window: 10
V_center: 102
V_window: 10
max_area: 100000
min_area: 10
color_id: yellow
H_center: 60
H_window: 10
S_center: 255
S_window: 10
V_center: 102
V_window: 10
max_area: 100000
min_area: 10
......@@ -43,14 +43,14 @@
<build_depend>iri_base_algorithm</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>OpenCV</build_depend>
<!--<build_depend>OpenCV</build_depend>-->
<build_depend>nodelet</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>iri_base_algorithm</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>OpenCV</run_depend>
<!--<run_depend>OpenCV</run_depend>-->
<run_depend>nodelet</run_depend>
<run_depend>cv_bridge</run_depend>
<run_depend>message_runtime</run_depend>
......
......@@ -54,6 +54,7 @@ void BlobDetectorAlgorithm::config_update(Config& new_cfg, uint32_t level)
this->v_max=this->config_.V_center+this->config_.V_window/2;
this->params.minArea = this->config_.min_area;
this->params.maxArea = this->config_.max_area;
ROS_INFO("Color_id: %s: H(%d,%d),S(%d,%d),V(%d,%d)", this->config_.color_id.c_str(), this->h_min, this->h_max, this->s_min, this->s_max, this->v_min, this->v_max);
}
this->unlock();
......@@ -104,10 +105,10 @@ void BlobDetectorAlgorithm::get_filter(iri_blob_detector::hsv_filter &filter)
this->lock();
filter.hue_center=(this->h_min+this->h_max);
filter.hue_window=(this->h_max-this->h_min)*2;
filter.saturation_center=(this->h_min+this->s_max)/2;
filter.saturation_window=(this->h_max-this->s_min);
filter.value_center=(this->h_min+this->v_max)/2;
filter.value_window=(this->h_max-this->v_min);
filter.saturation_center=(this->s_min+this->s_max)/2;
filter.saturation_window=(this->s_max-this->s_min);
filter.value_center=(this->v_min+this->v_max)/2;
filter.value_window=(this->v_max-this->v_min);
filter.blob_min_size=this->params.minArea;
filter.blob_max_size=this->params.maxArea;
this->unlock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment