# LP Tracker

## What is LicensePlateTracker?

`LicensePlateTracker` processes video streams with real-time license plate detection, tracking, and recognition. It maintains persistent vehicle identities across frames and uses Bayesian multi-frame text aggregation to improve OCR accuracy.

## When to Use LicensePlateTracker

Choose `LicensePlateTracker` when you need to:

* Process live camera feeds or RTSP streams in real-time
* Track vehicles with persistent IDs across video frames
* Improve OCR accuracy via Bayesian multi-frame text fusion
* Generate alerts and notifications for detected plates
* Save video clips with detected vehicles

**For simple batch image processing without temporal tracking**, use [LicensePlateRecognizer](/vehicle-analytics/guides/overview.md) instead.

## Core Concepts

### Configuration

All settings are controlled through `LicensePlateTrackerConfig`:

```python
import degirum_vehicle

config = degirum_vehicle.LicensePlateTrackerConfig(
    license_plate_detection_model_spec=detection_spec,  # Detection model
    license_plate_ocr_model_spec=ocr_spec,             # OCR model
    video_source="highway.mp4",                        # Video source
    live_stream_mode="LOCAL",                          # Display mode
)

tracker = degirum_vehicle.LicensePlateTracker(config)
```

See [Configuration Guide](/vehicle-analytics/guides/overview-1/configuration.md) for all options.

### Pipeline Architecture

The tracker uses a multi-stage streaming pipeline:

1. **Video Source** - Reads from camera, file, or RTSP stream
2. **License Plate Detection** - Detects plate regions in each frame
3. **Vehicle Tracking** - Tracks vehicles across frames with unique IDs
4. **Cropping** - Extracts detected plate regions
5. **OCR Recognition** - Runs text recognition on cropped plates
6. **Bayesian Fusion** - Aggregates OCR results across multiple frames per vehicle track
7. **Annotation** - Overlays tracking IDs and plate text on video
8. **Output** - Display, save to file, or stream via RTSP

The Bayesian fusion uses exponential moving average of character probabilities to improve accuracy over single-frame recognition.

### Key Features

**Vehicle Tracking**

* Unique track IDs for each vehicle
* Track persistence across frames
* Zone-based filtering (optional)
* Track trail visualization

**Multi-Frame Bayesian Text Aggregation**

* Combines OCR results across multiple frames
* Exponential moving average of character probabilities
* Improved accuracy vs. single-frame recognition
* Confidence scoring per track

**Video Processing**

* Live camera feeds (webcam, IP camera)
* Video files (MP4, AVI, etc.)
* RTSP streams
* Real-time display or RTSP streaming output

**Event Notifications**

* Configurable alert conditions
* Apprise notification support (email, Slack, Discord, etc.)
* Video clip storage with alerts

## Methods

`LicensePlateTracker` provides methods for video processing:

* [**start\_tracking\_pipeline()**](/vehicle-analytics/guides/overview-1/methods.md#start_tracking_pipeline) - Start real-time tracking pipeline
* [**predict\_batch()**](/vehicle-analytics/guides/overview-1/methods.md#predict_batch) - Process video stream and return results
* [**find\_plates\_in\_file()**](/vehicle-analytics/guides/overview-1/methods.md#find_plates_in_file) - Analyze entire video file
* [**find\_plates\_in\_clip()**](/vehicle-analytics/guides/overview-1/methods.md#find_plates_in_clip) - Analyze video from object storage

See [Methods Reference](/vehicle-analytics/guides/overview-1/methods.md) for complete API documentation with examples.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.degirum.com/vehicle-analytics/guides/overview-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
