@@ -27,7 +27,8 @@ class RemoveGrid : public Filter {
2727 public:
2828 explicit RemoveGrid (RemoveGridParams params) : params_(params) {}
2929
30- void apply_filter (const cv::Mat& original, cv::Mat& filtered) const override ;
30+ void apply_filter (const cv::Mat& original,
31+ cv::Mat& filtered) const override ;
3132
3233 private:
3334 RemoveGridParams params_;
@@ -47,7 +48,7 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
4748 }
4849
4950 // ----------------------------
50- // Rotate directly into cropped output
51+ // Rotate directly into cropped output
5152 // ----------------------------
5253 int crop_w = std::min (params_.width , original.cols );
5354 int crop_h = std::min (params_.height , original.rows );
@@ -57,18 +58,17 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
5758 " RemoveGrid: requested crop size (width={}, height={}) exceeds "
5859 " original image size (width={}, height={}); clamping to "
5960 " (width={}, height={})" ,
60- params_.width ,
61- params_.height ,
62- original.cols ,
63- original.rows ,
64- crop_w,
61+ params_.width , params_.height , original.cols , original.rows , crop_w,
6562 crop_h);
6663 }
6764
68- const cv::Point2f center_src (original.cols * 0 .5f , original.rows * 0 .5f ); // center of source image
69- const cv::Point2f center_dst (crop_w * 0 .5f , crop_h * 0 .5f ); // center of destination image
65+ const cv::Point2f center_src (
66+ original.cols * 0 .5f , original.rows * 0 .5f ); // center of source image
67+ const cv::Point2f center_dst (crop_w * 0 .5f ,
68+ crop_h * 0 .5f ); // center of destination image
7069
71- cv::Mat M = cv::getRotationMatrix2D (center_src, params_.rotation , 1.0 ); // affine matrix
70+ cv::Mat M = cv::getRotationMatrix2D (center_src, params_.rotation ,
71+ 1.0 ); // affine matrix
7272 // Ensure type for at<double>
7373 if (M.type () != CV_64F ) {
7474 M.convertTo (M, CV_64F );
@@ -108,7 +108,7 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
108108 dilated.col (dilated.cols - 1 ).setTo (0 );
109109
110110 if (cv::countNonZero (dilated) == 0 ) {
111- original.copyTo (filtered); // or original.copyTo(filtered);
111+ original.copyTo (filtered); // or original.copyTo(filtered);
112112 return ;
113113 }
114114
@@ -123,7 +123,8 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
123123 // Binary threshold (on cropped ROI)
124124 // ----------------------------
125125 cv::Mat thresh_gray;
126- apply_fixed_threshold (inpainted, thresh_gray, params_.threshold_binary , false );
126+ apply_fixed_threshold (inpainted, thresh_gray, params_.threshold_binary ,
127+ false );
127128
128129 cv::Mat thresh_bgr;
129130 cv::cvtColor (thresh_gray, thresh_bgr, cv::COLOR_GRAY2BGR );
@@ -140,7 +141,8 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
140141 cv::INTER_NEAREST , cv::BORDER_CONSTANT , cv::Scalar (0 , 0 , 0 ));
141142
142143 // Warp a mask the same way (so black pixels are copied too)
143- cv::Mat local_mask (thresh_bgr.rows , thresh_bgr.cols , CV_8U , cv::Scalar (255 ));
144+ cv::Mat local_mask (thresh_bgr.rows , thresh_bgr.cols , CV_8U ,
145+ cv::Scalar (255 ));
144146 cv::Mat mask_full;
145147 cv::warpAffine (local_mask, mask_full, invM, original.size (),
146148 cv::INTER_NEAREST , cv::BORDER_CONSTANT , cv::Scalar (0 ));
@@ -152,4 +154,4 @@ inline void RemoveGrid::apply_filter(const cv::Mat& original,
152154
153155} // namespace vortex::image_filtering
154156
155- #endif // IMAGE_FILTERING__LIB__FILTERS__REMOVE_GRID_HPP_
157+ #endif // IMAGE_FILTERING__LIB__FILTERS__REMOVE_GRID_HPP_
0 commit comments