概述
blur()函数可以用标准化的盒式过滤器来平滑图像。
API说明
C++ API:
功能说明
示例代码
void example()
{
cv::Mat input = cv::imread("C:\\Users\\BOX-Harry\\Desktop\\1.jpg"), output;
cv::namedWindow("example");
int size = 1, anchor_test = -1, anchor = -1;
cv::createTrackbar("Size", "example", &size, 120);
cv::createTrackbar("anchor", "example", &anchor_test, 120);
for (;;)
{
anchor = anchor_test;
if (anchor_test >= size)
anchor = size - 1;
cv::blur(input, output, cv::Size(size, size), cv::Point(anchor, anchor));
cv::imshow("example", output);
if (cv::waitKey(100) == 27)
break;
}
}