Computer Vision, Machine Learning, Deep Learning, AI, Projects.
cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) Calculate the area of the contours for cnt in contours: area = cv2.contourArea(cnt) # Draw a bounding box around each # object and display the area on the image x, y, w, h = cv2.boundingRect(cnt) cv2.rectangle(img, (x, y), (x+w, y+h), (0, 255, 0), 2)