draw bounding box on image python opencv

Solutions on MaxInterview for draw bounding box on image python opencv by the best coders in the world

showing results for - "draw bounding box on image python opencv"
Kane
22 Jun 2020
1# cv2.rectangle(img, pt1, pt2, color, thickness, lineType, shift)
2cv2.rectangle(img, (x1, y1), (x2, y2), (255,0,0), 2)
3
4"""
5x1,y1 ------
6|          |
7|          |
8|          |
9--------x2,y2
10"""
Noa
14 Sep 2018
1## drawing b.box for given coutour
2
3
4contours, _ = cv2.findContours(thresh, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
5for c in contours:
6    rect = cv2.boundingRect(c)
7    if rect[2] < 100 or rect[3] < 100: continue
8    print cv2.contourArea(c)
9    x,y,w,h = rect
10    cv2.rectangle(im,(x,y),(x+w,y+h),(0,255,0),2)
11    cv2.putText(im,'Moth Detected',(x+w+10,y+h),0,0.3,(0,255,0))
12cv2.imshow("Show",im)
13cv2.waitKey()  
14cv2.destroyAllWindows()
15
queries leading to this page
show image in opencv with bounding boxdraw bounding box on image python opencv from metadatadraw bounding box on image opencvdraw bounding boxes open cv2opencv draw bounding box without overwriting original imagecv2 draw bounding box and labelimage bounding box to character opencvcv2 draw bounding boxhow to draw a bounding box in opencv pythondraw bounding box on image python from computer visioncv2 draw bounding box around alldraw bounding box on image python cv2opencv draw bounding boxhow to draw bounding box on image pythondraw bounding box on image python from apidraw bounding box on image python opencvopencv python draw bounding boxhow to draw bounding box in opencv pythondraw bounding box on image pythonget bounding box around image opencvopencv draw bounding box pythonpython bounding box on imagepython cv2 draw bounding boxopencv bounding box print on imageadd image in bounding box opencv cv2 draw bounding box on image with changing fcolordraw bounding box opencvdraw bounding boxes on image python matplotlibdraw bounding boxes on image pythondraw bounding box on image python pilplot bounding box on image pythondraw bounding box cv2insert image into bounding box in open cvdraw bounding box on image python opencv pascalvochow to draw the bounding boxes on images using open cvdraw bounding box and text on image python opencvdraw bounding box opencv pythonopencv bounding box on an image objectopencv bounding box drawdraw a bounding box using cv2cv2 draw bounding box on imageopencv image bounding boxopencv images bounding boxuse bounding box to extract image cv2imshow bounding box opencv pythondraw bounding box on image python opencv