Files
opencv-learning/Blur/median.cpp
2026-03-19 19:16:42 +08:00

13 lines
298 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <opencv2/opencv.hpp>
int main() {
cv::Mat src = cv::imread("image.jpg");
cv::Mat dst;
// 参数:输入, 输出, 核大小(必须是大于1的奇数整数如3, 5, 7)
cv::medianBlur(src, dst, 5);
cv::imshow("Median Blur", dst);
cv::waitKey(0);
return 0;
}