- The parameter thickness can take positive and negative values. If the value is positive, it indicates the thickness of the outline. A negative value (for example, -1) indicates that a filled shape will be drawn. For example, to draw a filled ellipse, note the following:
cv2.ellipse(image, (80, 80), (60, 40), 0, 0, 360, colors['red'], -1)
You can also use cv2.FILLED:
cv2.ellipse(image, (80, 80), (60, 40), 0, 0, 360, colors['red'], cv2.FILLED)
- The lineType parameter can take three values (cv2.LINE_4 == 4, cv2.LINE_AA == 16, cv2.LINE_8 == 8). To draw Anti Aliased lines, you must use cv2.LINE_AA:
cv2.line(image, (0, 0), (20, 20), colors['red'], 1, cv2.LINE_AA)
- The diagonal line is created with the help of the following code: