tessl install tessl/pypi-imutils@0.5.0A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.
Agent Success
Agent success rate when using this tile
91%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.34x
Baseline
Agent success rate without this tile
68%
Build a simple utility that converts face detection results to OpenCV-compatible bounding box format.
Create a Python module that converts dlib rectangle objects (from face detection) into OpenCV bounding box tuples with the format (x, y, width, height).
Your solution should:
@generates
def convert_detection_to_bbox(rect):
"""
Convert a face detection rectangle to OpenCV bounding box format.
Args:
rect: A dlib rectangle object representing a detected face
Returns:
tuple: A 4-element tuple (x, y, w, h) where:
- x: left coordinate
- y: top coordinate
- w: width
- h: height
"""
pass
def convert_detections_to_bboxes(rects):
"""
Convert multiple face detection rectangles to OpenCV bounding box format.
Args:
rects: A list of dlib rectangle objects
Returns:
list: A list of tuples, each containing (x, y, w, h)
"""
passProvides utilities for converting between dlib and OpenCV coordinate formats.
Face detection library that outputs rectangle objects.