Skip to content

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.

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)

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)
SkillReturnsDescription
detect_and_annotate(image)(ndarray, int)Detect ChArUco corners on a BGR image; returns the annotated image and the number of corners found.