Skip to content

Commit

Permalink
[smoothing_filter] Add sample and test
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Aug 30, 2016
1 parent b30d5a2 commit 11efc5a
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
45 changes: 45 additions & 0 deletions launch/smoothing_filter.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<launch>
<arg name="gui" default="true" />
<arg name="image" default="image" doc="The image topic. Should be remapped to the name of the real image topic." />

<!-- smoothing.cpp -->
<node name="normalized_block_filter" pkg="opencv_apps" type="normalized_block_filter" >
<remap from="image" to="$(arg image)" />
</node>

<node name="bilateral_filter" pkg="opencv_apps" type="bilateral_filter" >
<remap from="image" to="$(arg image)" />
</node>

<node name="gaussian_filter" pkg="opencv_apps" type="gaussian_filter" >
<remap from="image" to="$(arg image)" />
</node>

<node name="median_filter" pkg="opencv_apps" type="median_filter" >
<remap from="image" to="$(arg image)" />
</node>

<group if="$(arg gui)">
<node name="image_view0"
pkg="image_view" type="image_view">
<remap from="image" to="image_rect_color" />
</node>
<node name="image_view1"
pkg="image_view" type="image_view">
<remap from="image" to="normalized_block_filter/image" />
</node>
<node name="image_view2"
pkg="image_view" type="image_view">
<remap from="image" to="bilateral_filter/image" />
</node>
<node name="image_view3"
pkg="image_view" type="image_view">
<remap from="image" to="gaussian_filter/image" />
</node>
<node name="image_view4"
pkg="image_view" type="image_view">
<remap from="image" to="median_filter/image" />
</node>
</group>

</launch>
53 changes: 53 additions & 0 deletions test/test-smoothing_filter.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<launch>
<arg name="gui" default="false" />
<node name="play_face_bag" pkg="rosbag" type="play" args="-l $(find opencv_apps)/test/face_detector_withface_test_diamondback.bag" />

<group ns="wide_stereo/left" >
<node name="image_proc" pkg="image_proc" type="image_proc" />
<node name="image_view" pkg="image_view" type="image_view" args="image:=image_rect_color" if="$(arg gui)" />

<!-- smoothing.cpp -->
<include file="$(find opencv_apps)/launch/smoothing_filter.launch" >
<arg name="image" value="image_rect_color" />
<arg name="gui" value="$(arg gui)" />
</include>

<!-- Test Codes -->
<node name="normalized_block_filter_saver_result" pkg="image_view" type="image_saver" args="image:=normalized_block_filter/image" >
<param name="filename_format" value="$(find opencv_apps)/test/normalized_block_filter_result.png"/>
</node>
<node name="bilateral_filter_saver_result" pkg="image_view" type="image_saver" args="image:=bilateral_filter/image" >
<param name="filename_format" value="$(find opencv_apps)/test/bilateral_filter_result.png"/>
</node>
<node name="gaussian_filter_saver_result" pkg="image_view" type="image_saver" args="image:=gaussian_filter/image" >
<param name="filename_format" value="$(find opencv_apps)/test/gaussian_filter_result.png"/>
</node>
<node name="median_filter_saver_result" pkg="image_view" type="image_saver" args="image:=median_filter/image" >
<param name="filename_format" value="$(find opencv_apps)/test/median_filter_result.png"/>
</node>
<param name="normalized_block_filter_test/topic" value="normalized_block_filter/image" />
<test test-name="normalized_block_filter_test" pkg="rostest" type="hztest" name="normalized_block_filter_test" >
<param name="hz" value="20" />
<param name="hzerror" value="15" />
<param name="test_duration" value="5.0" />
</test>
<param name="bilateral_filter_test/topic" value="bilateral_filter/image" />
<test test-name="bilateral_filter_test" pkg="rostest" type="hztest" name="bilateral_filter_test" >
<param name="hz" value="20" />
<param name="hzerror" value="15" />
<param name="test_duration" value="5.0" />
</test>
<param name="gaussian_filter_test/topic" value="gaussian_filter/image" />
<test test-name="gaussian_filter_test" pkg="rostest" type="hztest" name="gaussian_filter_test" >
<param name="hz" value="20" />
<param name="hzerror" value="15" />
<param name="test_duration" value="5.0" />
</test>
<param name="median_filter_test/topic" value="median_filter/image" />
<test test-name="median_filter_test" pkg="rostest" type="hztest" name="median_filter_test" >
<param name="hz" value="20" />
<param name="hzerror" value="15" />
<param name="test_duration" value="5.0" />
</test>
</group>
</launch>

0 comments on commit 11efc5a

Please sign in to comment.