diff --git a/src/image_cv.cpp b/src/image_cv.cpp index 64b4130..5f45510 100644 --- a/src/image_cv.cpp +++ b/src/image_cv.cpp @@ -76,6 +76,12 @@ cv::Mat image_binerize(cv::Mat &frame) cv::bitwise_or(output, binarizedFrame, output); + // V 通道反光剔除: 高亮度(V>180) 且 低饱和度(S<40) → 白反光,标记为非赛道 + cv::Mat hi_v, lo_s; + cv::threshold(hsvChannels[2], hi_v, 180, 255, cv::THRESH_BINARY); + cv::threshold(hsvChannels[1], lo_s, 40, 255, cv::THRESH_BINARY_INV); + output.setTo(0, hi_v & lo_s); + return output; }