32 #include <opencv2/core/core.hpp>
33 #include <opencv2/highgui/highgui.hpp>
34 #include <opencv2/imgproc/imgproc.hpp>
40 #include <sensor_msgs/Image.h>
76 priv.
param(
"mask", mask, std::string(
""));
79 mask_ = cv::imread(mask, 0);
93 mask_ = cv::Mat::ones(cv_image->image.size(), CV_8U);
95 else if (
mask_.rows != cv_image->image.rows ||
mask_.cols != cv_image->image.cols)
97 cv::resize(
mask_,
mask_, cv_image->image.size(), 1.0, 1.0, cv::INTER_NEAREST);
102 if (over_exposure_threshold_ < 255 && over_exposure_threshold_ > 0)
105 cv::Mat element = cv::getStructuringElement(
109 cv::dilate(over_exposed, over_exposed, element);
111 mask =
mask_.clone();
112 mask.setTo(0, over_exposed);