Skip to content

Commit

Permalink
last kinetic version Fco Bonin
Browse files Browse the repository at this point in the history
  • Loading branch information
francescbonin committed Sep 29, 2020
1 parent b9ec247 commit f689b5d
Show file tree
Hide file tree
Showing 44 changed files with 117 additions and 16 deletions.
Empty file modified CMakeLists.txt
100644 → 100755
Empty file.
Binary file added data/stereo_forward_day/vignetting_mean_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/stereo_forward_day/vignetting_std_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/stereo_forward_day/vignetting_std_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/vignetting_mean_left.png
Binary file not shown.
Binary file removed data/vignetting_mean_right.png
Binary file not shown.
Binary file removed data/vignetting_std_left.png
Binary file not shown.
Binary file removed data/vignetting_std_right.png
Binary file not shown.
Empty file modified include/image_preprocessing/clahs.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/color_correction.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/dehazer.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/flicker_remover.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/mono_clahs.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/mono_dehazer.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/stereo_clahs.h
100644 → 100755
Empty file.
Empty file modified include/image_preprocessing/stereo_dehazer.h
100644 → 100755
Empty file.
22 changes: 22 additions & 0 deletions launch/clahs.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<launch>

<arg name="bagfile" default="/home/plnegre/workspace/ros/data/bagfiles/2015_Valldemossa/06/2015-06-08-20-31-46_2.bag" />

<param name="/use_sim_time" value="true"/>
<arg name="camera" default="/stereo_down"/>

<node pkg="rosbag" type="play" name="rosbag" args="--clock $(arg bagfile) -r 0.2" />

<include file="$(find turbot)/launch/modules/stereo_pipeline.launch">
<arg name="stereo" value="$(arg camera)" />
</include>

<node pkg="image_preprocessing" type="stereo_clahs_node" name="clahs_node" respawn="true" output="screen" >
<remap from="stereo" to="$(arg camera)/scaled_x2"/>
</node>

<node pkg="image_preprocessing" type="stereo_dehazer_node" name="dehazer_node" respawn="true" output="screen" >
<remap from="stereo" to="$(arg camera)/scaled_x2"/>
</node>

</launch>
26 changes: 26 additions & 0 deletions launch/clahs_emisari27092017.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<launch>

<arg name="bagfile" default="/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-01_36.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-33_37.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-05_38.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-37_39.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-56-09_40.bag" />

<param name="/use_sim_time" value="true"/>
<arg name="camera" default="/stereo_down"/>

<node pkg="rosbag" type="play" name="rosbag" args="--clock $(arg bagfile) -r 0.2" />

<include file="$(find turbot)/launch/modules/stereo_pipeline.launch">
<arg name="stereo" value="$(arg camera)" />
</include>

<node pkg="image_preprocessing" type="stereo_clahs_node" name="clahs_node" respawn="true" output="screen" >
<remap from="stereo" to="$(arg camera)/scaled_x2"/>
</node>

<node pkg="image_preprocessing" type="stereo_dehazer_node" name="dehazer_node" respawn="true" output="screen" >
<remap from="stereo" to="$(arg camera)/scaled_x2"/>
</node>

</launch>
4 changes: 4 additions & 0 deletions launch/clahs_test.launch
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<arg name="stereo" value="$(arg camera)" />
</include>

<node pkg="image_preprocessing" type="stereo_clahs_node" name="clahs_node" respawn="true" output="screen" >
<remap from="stereo" to="$(arg camera)/scaled_x2"/>
</node>

<node pkg="image_preprocessing" type="clahs" name="clahs" output="screen">
<remap from="image" to="$(arg camera)/scaled_x2/left/image_rect_color"/>
</node>
Expand Down
Empty file modified launch/color_correction_image.launch
100644 → 100755
Empty file.
Empty file modified launch/flicker_remover.launch
100644 → 100755
Empty file.
42 changes: 32 additions & 10 deletions launch/remove_vignetting.launch
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<launch>

<arg name="bagfiles" default="/home/plnegre/bagfiles/images170927_1234_2017-09-27-10-43-51_17.bag"/>
<arg name="bagfiles" default="/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-01_36.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-33_37.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-05_38.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-37_39.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-56-09_40.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-56-41_41.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-57-13_42.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-57-45_43.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-58-17_44.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-58-49_45.bag"/>

<arg name="camera" default="stereo_forward"/>
<arg name="image" default="image_raw"/>
Expand All @@ -9,30 +18,43 @@

<node pkg="rosbag" type="play" name="player" args="--clock -d 5 -l $(arg bagfiles)"/>

<group ns="$(arg camera)">
<!--group ns="$(arg camera)">
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/>
</group>
</group-->

<group ns="/vig/$(arg camera)">
<!--include file="$(find turbot)/launch/modules/stereo_pipeline.launch">
<arg name="stereo" value="$(arg camera)" />
</include-->

<include file="$(find turbot)/launch/modules/stereo_pipeline.launch">
<arg name="stereo" value="/vig/$(arg camera)" />
</include>

<!--group ns="/vig/$(arg camera)">
<node pkg="stereo_image_proc" type="stereo_image_proc" name="stereo_image_proc"/>
</group>
</group-->

<node pkg="image_preprocessing" type="vignetting_remover" name="vignetting_remover_l" output="screen">
<param name="mean_filename" value="$(find image_preprocessing)/data/vignetting_mean_left.png"/>
<param name="std_filename" value="$(find image_preprocessing)/data/vignetting_std_left.png"/>
<param name="output_namespace" value="/vig/$(arg camera)/left"/>
<remap from="image" to="$(arg camera)/left/$(arg image)"/>
</node>
<node pkg="image_preprocessing" type="vignetting_remover" name="vignetting_remover_r" output="screen">

<!--node pkg="image_preprocessing" type="vignetting_remover" name="vignetting_remover_r" output="screen">
<param name="mean_filename" value="$(find image_preprocessing)/data/vignetting_mean_right.png"/>
<param name="std_filename" value="$(find image_preprocessing)/data/vignetting_std_right.png"/>
<param name="output_namespace" value="/vig/$(arg camera)/right"/>
<remap from="image" to="$(arg camera)/right/$(arg image)"/>
</node>

</node-->
<node pkg="image_preprocessing" type="color_correction_image" name="color_correction_image" output="screen">
<remap from="/color_correction_image/input" to="/vig/$(arg camera)/left/image_rect_color"/>
<remap from="/color_correction_image/output" to="/vig/$(arg camera)/left/image_rect_color_corrected"/>
<remap from="/color_correction_image/input" to="/vig/$(arg camera)/scaled_x2/left/image_rect_color"/>
<remap from="/color_correction_image/output" to="/vig/$(arg camera)/scaled_x2/left/image_rect_color_corrected"/>
</node>

<!--node pkg="image_preprocessing" type="stereo_clahs_node" name="clahs_node" respawn="true" output="screen" >
<remap from="stereo" to="/vig/$(arg camera)/scaled_x2"/>
</node-->

</launch>
Empty file modified launch/test.launch
100644 → 100755
Empty file.
Empty file modified launch/train_vignetting.launch
100644 → 100755
Empty file.
28 changes: 28 additions & 0 deletions launch/vignetting.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<launch>
<arg name="bagfiles" default="/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-01_36.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-54-33_37.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-05_38.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-55-37_39.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-56-09_40.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-56-41_41.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-57-13_42.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-57-45_43.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-58-17_44.bag
/home/xesc/BAGFILES_BAG/emisari_27092017/images170927_1234_2017-09-27-10-58-49_45.bag"/>

<arg name="camera" default="stereo_forward/right"/>
<arg name="image" default="image_raw"/>


<param name="use_sim_time" value="true"/>

<node pkg="rosbag" type="play" name="player" args="--clock -d 5 $(arg bagfiles)" output="screen" />

<group ns="$(arg camera)">
<node pkg="image_proc" type="image_proc" name="image_proc" output="screen"/>
</group>

<node pkg="image_preprocessing" type="vignetting_extractor" name="vignetting_extractor" output="screen">
<remap from="image" to="$(arg camera)/$(arg image)"/>
</node>
</launch>
Empty file modified package.xml
100644 → 100755
Empty file.
Empty file modified src/clahs.cpp
100644 → 100755
Empty file.
Empty file modified src/color_correction.cpp
100644 → 100755
Empty file.
Empty file modified src/dehazer.cpp
100644 → 100755
Empty file.
Empty file modified src/flicker_remover.cpp
100644 → 100755
Empty file.
Empty file modified src/mono_clahs.cpp
100644 → 100755
Empty file.
Empty file modified src/mono_dehazer.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/clahs_node.cpp
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions src/nodes/color_correction_image_node.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ using namespace cv;
image_transport::Subscriber img_sub_;
image_transport::Publisher img_pub_;

void cv_clahe(cv::Mat _src, cv::Mat& _dst) {
void cv_clahe(cv::Mat _src, cv::Mat& _dst, int gain) {
cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE();
clahe->setClipLimit(2);
clahe->setClipLimit(gain);
clahe->apply(_src, _dst);
return;
}
Expand All @@ -46,9 +46,9 @@ void imageCallback(const sensor_msgs::ImageConstPtr &image_msg) {

// Equalizes the histogram of a one channel image (8UC1) using Contrast
// Limited Adaptive Histogram Equalization.
std::thread thread_b(cv_clahe, BGR[0], std::ref(BGR[0]));
std::thread thread_g(cv_clahe, BGR[1], std::ref(BGR[1]));
std::thread thread_r(cv_clahe, BGR[2], std::ref(BGR[2]));
std::thread thread_b(cv_clahe, BGR[0], std::ref(BGR[0]),2);
std::thread thread_g(cv_clahe, BGR[1], std::ref(BGR[1]),2);
std::thread thread_r(cv_clahe, BGR[2], std::ref(BGR[2]),2);
thread_b.join();
thread_g.join();
thread_r.join();
Expand Down
Empty file modified src/nodes/color_correction_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/dehazer_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/flicker_remover_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/stereo_clahs_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/stereo_dehazer_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/vignetting_extractor_node.cpp
100644 → 100755
Empty file.
Empty file modified src/nodes/vignetting_remover_node.cpp
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion src/stereo_clahs.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ StereoClahs::StereoClahs(ros::NodeHandle nh, ros::NodeHandle nhp)
ros::names::clean(stereo_ns + "/clahs/left/image_rect"), 1);
right_mono_pub_ = it.advertiseCamera(
ros::names::clean(stereo_ns + "/clahs/right/image_rect"), 1);

left_color_pub_ = it.advertiseCamera(
ros::names::clean(stereo_ns + "/clahs/left/image_rect_color"), 1);
right_color_pub_ = it.advertiseCamera(
Expand Down
Empty file modified src/stereo_dehazer.cpp
100644 → 100755
Empty file.

0 comments on commit f689b5d

Please sign in to comment.