code: def draw_line(self, img, pixmapper, pt1, pt2, colour, linewidth):
          '''draw a line on the image'''
          pix1 = pixmapper(pt1)
          pix2 = pixmapper(pt2)
          clipped = cv.ClipLine((img.width, img.height), pix1, pix2)
          if clipped is None:
              if len(self._pix_points) == 0:
                  self._pix_points.append(None)
              self._pix_points.append(None)
              return
          (pix1, pix2) = clipped
          cv.Line(img, pix1, pix2, colour, linewidth)
          cv.Circle(img, pix2, linewidth*2, colour)
          if len(self._pix_points) == 0:
              self._pix_points.append(pix1)
          self._pix_points.append(pix2f draw_line(self, img, pixmapper, pt1, pt2, colour, linewidth):
          '''draw a line on the image'''
          pix1 = pixmapper(pt1)
          pix2 = pixmapper(pt2)
          clipped = cv.ClipLine((img.width, img.height), pix1, pix2)
          if clipped is None:
              if len(self._pix_points) == 0:
                  self._pix_points.append(None)
              self._pix_points.append(None)
              return
          (pix1, pix2) = clipped
          cv.Line(img, pix1, pix2, colour, linewidth)
          cv.Circle(img, pix2, linewidth*2, colour)
          if len(self._pix_points) == 0:
              self._pix_points.append(pix1)
          self._pix_points.append(pix2)
docs: draw a line on the image