Drawing fancy rectangle around face

前端 未结 4 840
情深已故
情深已故 2021-02-14 23:40

I am using the following code to detect face and draw rectangle on top of the face.

while True:
    # get video frame
    ret, img = cap.read()

    input_img =          


        
4条回答
  •  無奈伤痛
    2021-02-14 23:49

    I did something naive. You can implement with further modifications using a function.

    Steps:

    1. I manually marked a rectangle around the text and extracted the 4 points.

    2. Then I fixed a length for the line to be drawn from these 4 points.

    Result:

    Functions used:

    • cv2.line()
    • cv2.rectangle()

    See THIS LINK for details about their usage.

提交回复
热议问题