Detect and Annotate
SUMMARY
detect_and_annotate() detects ChArUco corners on a BGR image and returns the annotated image plus the number of corners found.
SUPPORTED TARGETS
Available only on CharucoTarget.
UNITS
The input image must be a BGR ndarray. Returns the annotated image in the same format, and the corner count as an integer.
The Skill
python
annotated_image, num_corners = charuco.detect_and_annotate(image)The Code
python
import cv2
from telekinesis.axon.targets import CharucoTarget
charuco = CharucoTarget(squares_x=6, squares_y=9, square_length=0.012, marker_length=0.009)
image = cv2.imread("frame.png")
annotated_image, num_corners = charuco.detect_and_annotate(image)
print(f"Detected {num_corners} ChArUco corners")
cv2.imwrite("frame_annotated.png", annotated_image)