[How to use the cv::erode() function to corrode an image]

cv::erode()The main purpose of the function

cv::erode()The function is mainly used for image erosion operation. This is an image processing technique commonly used to remove noise from an image, to separate two connected objects, or to make the boundaries of objects more visible.

The basic idea of ​​erosion operation is to "erode" the edges of objects in the image. Specifically, if the structural element (convolution kernel) can be completely contained inside the object, then the central pixel of the object will maintain its original value; otherwise, the pixel will be "corroded", usually set to black.

Here is a simple cv::erode()example using the function:

#include <opencv2/opencv.hpp>

int main(

Guess you like

Origin blog.csdn.net/qq_21950671/article/details/132077905