Line 1: Import OpenCV package using "import cv2"
It is used to create an empty black image of specified size(Row x Col). We need a surface to draw lines, circle etc. and this function provides us that surface by creating an empty black surface where we can make drawings.
- row,col: specify row and col in terms of number of pixels for eg. (640,480)
- channel: specify the type of image. grayscale or color. We pass 3 for color.
- dtype(optional): datatype of pixel values. by default np.float64
- order(optional): row wise or column wise. by default 'C'
- img is the image that we just made using np.zeros. This specifies that we want to draw on that image
- start_co-ordinate is the starting point of the line for eg. (0,0) i.e the top left of the screen
- end_co-ordinate is the end point of the line for eg. (480,640). Remember that 480 is the column size and 640 is the row size. This is in contrast with what we wrote in np.zeros().
- color defines the color of the line you want to draw. For eg. (255,0,0) i.e. BLUE color line
- thickness defines the thickness of the line we want to draw. For eg. 2