Commit 0f60d084 authored by Mederic Fourmy's avatar Mederic Fourmy
Browse files

Add CLAHE preproc option to the processor

parent 85aceb6e
...@@ -14,6 +14,11 @@ max_new_features: 100 ...@@ -14,6 +14,11 @@ max_new_features: 100
#################################### ####################################
# ProcessorVisualOdometry parameters # ProcessorVisualOdometry parameters
# CLAHE = Contrast Limited Adaptive Histogram Equalization
# -> more continuous lighting and higher contrast images, 1-1.5 ms overhead
use_clahe: true
# FAST KeyPoint detection # FAST KeyPoint detection
fast_params: fast_params:
# Threshold on the keypoint pixel intensity (in uchar [0-255]) # Threshold on the keypoint pixel intensity (in uchar [0-255])
......
...@@ -82,6 +82,7 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker ...@@ -82,6 +82,7 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker
}; };
double std_pix_; double std_pix_;
bool use_clahe_;
RansacParams ransac_params_; RansacParams ransac_params_;
KltParams klt_params_; KltParams klt_params_;
FastParams fast_params_; FastParams fast_params_;
...@@ -95,6 +96,8 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker ...@@ -95,6 +96,8 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker
{ {
std_pix_ = _server.getParam<int>(prefix + _unique_name + "/std_pix"); std_pix_ = _server.getParam<int>(prefix + _unique_name + "/std_pix");
use_clahe_ = _server.getParam<bool>(prefix + _unique_name + "/use_clahe");
ransac_params_.ransac_prob_ = _server.getParam<double>(prefix + _unique_name + "/ransac_params/ransac_prob"); ransac_params_.ransac_prob_ = _server.getParam<double>(prefix + _unique_name + "/ransac_params/ransac_prob");
ransac_params_.ransac_thresh_ = _server.getParam<double>(prefix + _unique_name + "/ransac_params/ransac_thresh"); ransac_params_.ransac_thresh_ = _server.getParam<double>(prefix + _unique_name + "/ransac_params/ransac_thresh");
...@@ -119,6 +122,7 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker ...@@ -119,6 +122,7 @@ struct ParamsProcessorVisualOdometry : public ParamsProcessorTracker
std::string print() const override std::string print() const override
{ {
return ParamsProcessorTracker::print() + "\n" return ParamsProcessorTracker::print() + "\n"
+ "use_clahe_: " + std::to_string(use_clahe_) + "\n"
+ "ransac_params_.ransac_prob_: " + std::to_string(ransac_params_.ransac_prob_) + "\n" + "ransac_params_.ransac_prob_: " + std::to_string(ransac_params_.ransac_prob_) + "\n"
+ "ransac_params_.ransac_thresh_: " + std::to_string(ransac_params_.ransac_thresh_) + "\n" + "ransac_params_.ransac_thresh_: " + std::to_string(ransac_params_.ransac_thresh_) + "\n"
+ "klt_params_.tracker_width_: " + std::to_string(klt_params_.patch_width_) + "\n" + "klt_params_.tracker_width_: " + std::to_string(klt_params_.patch_width_) + "\n"
......
...@@ -86,10 +86,12 @@ void ProcessorVisualOdometry::preProcess() ...@@ -86,10 +86,12 @@ void ProcessorVisualOdometry::preProcess()
cv::Mat img_incoming = capture_image_incoming_->getImage(); cv::Mat img_incoming = capture_image_incoming_->getImage();
// Adaptive Histogram Correction to get more continuous lighting and higher contrast if (params_visual_odometry_->use_clahe_){
// Seems to give better tracking but a bit slow, TOBENCHMARK // Contrast Limited Adaptive Histogram Equalization
// cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE(2.0, cv::Size(8,8)); // -> more continuous lighting and higher contrast images
// clahe->apply(img_incoming, img_incoming); cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE(2.0, cv::Size(8,8));
clahe->apply(img_incoming, img_incoming);
}
// Time to PREPreprocess the image if necessary: greyscale if BGR, CLAHE etc... // Time to PREPreprocess the image if necessary: greyscale if BGR, CLAHE etc...
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment