Functions used in this project
import cv2 : it means to import cv2 library to access its function in our current program.
import: the import keyboard is used to import other modules into Python script.
import numpy as np : it means to import numpy library to access its functions in our current program and 'as np' means numpy has given short form np.
cv2.imread : To read an image in Python using OpenCV, we use cv2.imread() function.
cv2.VideoCapture : function which is used to work with the camera, we can do the following task - read video, display video and save video. Capture from the camera and display it.
cv2.imread() : It is used to read an image in Python using OpenCV.
cv2.IMREAD_GRAYSCALE - loads image in grayscale mode.
cv2.IMREAD_UNCHANGED - loads image as such including alpha channel.
cv2.flip() : This method is used to flip a 2D array. The function cv:: flip, flips a 2D array around vertical, horizontal, or both axes.
cv2.cvtColor(frame,cv2.COLOR_BGR2HSV) : This function is used to convert an image from RGB color space to HSV. This increases the saturation of the image by multiplying the S channel by a scale factor. There are more than 150 color space conversion methods available in OpenCV.
np.array() : It gives an enormous range of fast and efficient ways of creating arrays and manipulating numerical data inside them, while a Python list can contain different data types within a single list, all elements in a numpy array should be homogeneous.
cv2.inRange() : The method which returns a mask, specifying which pixels fall into your specified upper and lower range. Finally, now that you have the mask, you can apply it to your image using the cv2. bitwise_and function.
cv2.dilate() : To apply a morphological filter to images in Python using OpenCV, use the cv2 dilate() method. The dilate() method takes two inputs in which one is our input image; the second is called the structuring element or kernel, which decides the nature of the operation.
np.ones() : function returns a new array of given shape and data type, where the element's value is set to 1. This function is very similar to numpy zeros() function.
ones() function arguments. The numpy.ones() function syntax is: ones(shape, dtype=None, order='C') The shape is an int or tuple of ints to define the size of the array and the default data type(dtype) is set to int.
For example: np.ones(5)
It will return the array of [1. 1. 1. 1. 1.]
cv2.morphologyEx() : It is the difference between dilation and erosion of an image.