1.cvtColor(frame,para): used for image color space conversion
For example: gray_frame = cv.cvtColor(img,cv.COLOR_BGR2GRAY) : grayscale processing
para:CV_BGR2GRAY,CV_RGB2GRAY--convert to grayscale image
2.GaussianBlur(input src,kernel dst , int d = 0, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT ): Gaussian (high-pass) filter function ---- Improve the pixel's brightness according to the brightness difference between the pixel and surrounding pixels brightness
For example: gray_frame = cv.GaussianBlur(img,(21,21),0) : blurring
src: original image data
dst: Gaussian filter kernel size
d: pixel value size
The latter parameters can be set as default
3.cv.VideoCapture(0).read(): Get the video camera class
ret , frame = camera.read() gets the frame image read from
4.cv.absdiff(src1 ,src2 ,dist): Get the difference between two images
For example: img = absdiff(img1,img2)
dist: can not be written by default
5.cv.threshol d ( src,dst, double threshold, double max_value, int threshold_type ): Operate the grayscale image to obtain a binary image, such as removing large or small element point noise
例如:cv.threshold(img,25,255,cv.THRESH_BINARY)
threshold: threshold
6.cv.dilate(img,es,iterations = 2): dilate the image---thereby normalizing holes and defects
7.cv.findContours(): Calculate the contour of the target in an image
8.img.copy(): copy a copy to a new variable