Overview

This convenience function iterates through all crossing lines managed by a Crossings object and draws each one with its individual styling and count information using the crossing() function.

Function Signature

crossings(
    image: np.ndarray
) -> np.ndarray

Parameters

image
np.ndarray
required
Input BGR image to annotate. Must be a 3-channel NumPy array with shape (height, width, 3). crossings_manager: Crossings manager object containing multiple crossing lines. Must have a ‘crossings’ attribute that is iterable, containing Crossing objects.

Returns

result
np.ndarray
The input image with all crossing lines and count annotations drawn. Same shape and dtype as input image. Image is modified in-place.

Examples

import cv2
import pixelflow as pf

# Load image and create crossing manager
image = cv2.imread("intersection.jpg")
crossings_manager = pf.Crossings()

# Add multiple crossing lines
crossings_manager.add_crossing(

Error Handling

This function may raise the following exceptions:
  • AttributeError: If crossings_manager lacks ‘crossings’ attribute or if individual crossing objects lack required attributes.
  • AssertionError: If image is not a NumPy array (raised by underlying crossing() calls).

Notes

  • Each crossing line is drawn with its individual color, name, and styling
  • The function processes crossings in the order they appear in the manager
  • All crossing lines share the same adaptive sizing parameters based on image resolution
  • The input image is modified in-place for efficiency
  • This is equivalent to calling crossing() individually for each line