Learn how the Extended Kalman Filter (EKF) handles non-linear systems for accurate object tracking and sensor fusion. Enhance your [YOLO26](https://docs.ultralytics.com/models/yolo26/) projects on the [Ultralytics Platform](https://platform.ultralytics.com).
The Extended Kalman Filter (EKF) is a robust mathematical algorithm designed to estimate the state of a dynamic system that behaves non-linearly. While the standard Kalman Filter (KF) provides an optimal solution for systems moving in straight lines or following simple linear equations, real-world physics is rarely that predictable. Most physical objects, such as a drone fighting wind resistance or a robotic arm rotating on multiple axes, follow curved or complex paths. The EKF addresses this complexity by creating a linear approximation of the system at a specific point in time, allowing engineers and data scientists to apply efficient filtering techniques to predictive modeling tasks even when the underlying mechanics are complicated.
To handle complex dynamics, the EKF employs a mathematical process called linearization, which essentially estimates the slope of a function at the current operating point. This often involves calculating a Jacobian matrix to approximate how the system changes over short intervals. The algorithm operates in a recursive loop consisting of two main phases: prediction and update. In the prediction phase, the filter projects the current state forward using a physical model of motion. In the update phase, it corrects this projection using new, often noisy data from sensors like gyroscopes or accelerometers. This continuous cycle of predicting and correcting helps reduce data noise and provides a smoother, more accurate estimate of the true state than any single sensor could provide alone.
No domínio da visão computacional (CV), o Filtro de Kalman Estendido desempenha um papel fundamental na manutenção da identidade de itens em movimento. Modelos avançados como o YOLO26 são excepcionais na detecção de objetos em quadros únicos , mas não compreendem inerentemente a continuidade do movimento ao longo do tempo. Ao integrar um EKF ou lógica semelhante, um sistema de rastreamento de objetos pode prever onde uma caixa delimitadora deve aparecer no próximo quadro de vídeo com base na sua velocidade e trajetória anteriores. Isso é particularmente útil para lidar com oclusões, em que um objeto é temporariamente bloqueado da visão; o filtro mantém o "track" ativo, estimando a posição do objeto até que ele fique visível novamente, uma técnica essencial para um rastreamento robusto de múltiplos objetos (MOT).
The versatility of the EKF makes it a cornerstone technology in various high-tech industries where machine learning (ML) intersects with physical hardware:
É útil distinguir o Filtro de Kalman Estendido de métodos de filtragem relacionados para compreender a sua utilidade específica :
No ultralytics package, tracking algorithms use Kalman filtering concepts internally to smooth
trajectories and associate detections across frames. While you do not manually code the EKF matrix math when using
high-level tools, understanding that it powers the tracker helps in configuring parameters for the
Plataforma Ultralytics.
Here is how to initiate a tracker with a YOLO model, which utilizes these filtering techniques for state estimation:
from ultralytics import YOLO
# Load the latest YOLO26 model (nano version for speed)
model = YOLO("yolo26n.pt")
# Track objects in a video source
# Trackers like BoT-SORT or ByteTrack use Kalman filtering logic internally
results = model.track(source="https://ultralytics.com/images/bus.jpg", tracker="botsort.yaml")
# Print the ID of the tracked objects
for r in results:
if r.boxes.id is not None:
print(f"Track IDs: {r.boxes.id.numpy()}")