Draw a LineDraw a Line

In OpenCV, the cv2.line() function is used to draw a line on an image. The function takes in six required parameters: the image to be modified, the starting point of the line (specified as a tuple of x and y coordinates), the ending point of the line (specified as a tuple of x and y coordinates), the color of the line (specified as a tuple of Red, Green, Blue values), and the thickness of the line.

Task

  1. Define the ending coordinates for the line.
  2. Use the line() function to draw a line on image1.

Everything was clear?

Section 1. Chapter 10

Start learning today and achieve
coding mastery

  • Master Python, SQL, JavaScript & more.
  • Learn with Step-by-Step Lessons.
  • Get Ready for Real-World Projects.
  • Earn a Certificate Upon Completion.