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

14 lines
355 B
C++
Raw Permalink 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;
// 参数:输入, 输出, 核大小, sigmaX(标准差), sigmaY
// 如果 sigmaY 为 0则默认与 sigmaX 相等
cv::GaussianBlur(src, dst, cv::Size(5, 5), 0);
cv::imshow("Gaussian Blur", dst);
cv::waitKey(0);
return 0;
}