Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the filtering effect of OpenCV Box in C++

Shulou Source: shulou.com Published: 2022-06-01 09:47:33 10月01日 Update

This article will explain in detail how to achieve the OpenCV box filtering effect on C++. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

1. Square filtering

    square filtering is a form of mean filtering. In the mean filtering, the pixel value of the filtering result is the neighborhood average value of any point, which is equal to the mean value of the sum of the neighborhood pixel values, while in the square filtering, you can freely choose whether to normalize the mean filtering results, that is, you can freely choose whether the filtering result is the average value of the sum of neighborhood pixel values or the sum of neighborhood pixel values.

2. C++ code # include # include using namespace cv;using namespace std;int main () {/ /-the image used for box filtering-Mat img = imread ("1.jpg"); if (img.empty ()) {cout

Tags: Box mean Pixel result Image neighborhood effect Clippers Sum Article original Free Code mean Square Sum more Type Select good practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi Linux Shulou Technology Docker