Skip to content

Lines

Represents 2D lines in Hough form: rho (distance from origin to the closest point on the line) and theta (angle with the x-axis). This datatype is used for line-detection outputs (e.g. Hough transform) and geometry annotations within the Telekinesis ecosystem.

Field

Required

FieldTypeDescription
rhofloat or ArrayLikeDistance from origin to the line; scalar or 1D array, dtype float32.
thetafloat or ArrayLikeAngle with x-axis in radians; scalar or 1D array, dtype float32.

rho and theta must have the same length when provided as arrays.

Optional

None.

Methods

MethodDescription
to_dict()Returns a dictionary with keys: rho (scalar or 1D array), theta (scalar or 1D array).

Example

From the datatypes examples:

python
from datatypes import datatypes
from loguru import logger

# ------------------------------------------------
# 1. Create Lines instance
# ------------------------------------------------
lines = datatypes.Lines(rho=[1.0, 2.0], theta=[45.0, 90.0])

# ------------------------------------------------
# 2. Access data via to_dict
# ------------------------------------------------
data = lines.to_dict()
logger.info("Lines to_dict rho={}", data["rho"])
logger.info("Lines to_dict theta={}", data["theta"])