SimpleLPR Python
🚗 High-performance license plate recognition for Python developers. Detect and read vehicle license plates from images and video streams with just a few lines of code.
🎯 Overview
SimpleLPR brings professional-grade license plate recognition to Python. Whether you're building a parking management system, analyzing traffic patterns, or developing security applications, SimpleLPR handles the complexity of plate detection and OCR so you can focus on your application logic.
Built on over 10 years of continuous development and deployed in thousands of production systems worldwide, SimpleLPR delivers reliable performance with a developer-friendly API.
✨ Key Features
- 📊 High Accuracy: 85-95% recognition rate under typical conditions
- ⚡ Real-time Processing: Analyze video streams with multi-threaded performance
- 🌍 Global Coverage: Support for ~90 countries with region-specific formats
- 🔄 Video Tracking: Track plates across frames for improved accuracy
- 🐍 Pythonic API: Native Python interface that feels natural
- 🏭 Production Ready: Battle-tested in commercial deployments worldwide
📋 What is SimpleLPR?
SimpleLPR is more than just an OCR library - it's a complete license plate recognition system that handles the entire workflow from image acquisition to final text output. The library automatically:
- Detects license plates in complex scenes
- Extracts the plate region with precise boundaries
- Corrects perspective and lighting issues
- Reads alphanumeric characters with high accuracy
- Validates results against country-specific formats
- Tracks plates across video frames for consistency
🎯 Real-World Performance
SimpleLPR achieves industry-leading accuracy under typical conditions:
- Plate text height of at least 20 pixels
- Reasonable image quality without severe motion blur
- Plates in good physical condition
- Viewing angles within ±30 degrees
The library has been extensively tested in production environments including:
- 🅿️ Parking facilities with varying lighting conditions
- 🛣️ Highway toll collection systems processing thousands of vehicles
- 🚪 Access control gates with fixed camera positions
- 📱 Mobile enforcement units with handheld cameras
- 📹 Traffic monitoring systems with wide-angle views
💻 Requirements
- Python: 3.8, 3.9, 3.10, 3.11, or 3.12 (64-bit)
- OS: Windows x64, Linux x64 (Ubuntu 20.04+)
- Memory: 2GB RAM minimum, 4GB+ recommended for video
- License: 60-day trial included, production licenses available
📦 Installation
pip install SimpleLPR
🚀 Quick Start
Basic Image Recognition
import simplelpr
# Initialize the engine
setup_params = simplelpr.EngineSetupParms()
engine = simplelpr.SimpleLPR(setup_params)
# Configure for your country (e.g., UK = 90)
engine.set_countryWeight(90, 1.0)
engine.realizeCountryWeights()
# Create a processor
processor = engine.createProcessor()
# Analyze an image
candidates = processor.analyze("car_image.jpg")
# Print results
for candidate in candidates:
for match in candidate.matches:
print(f"Plate: {match.text}")
print(f"Confidence: {match.confidence:.3f}")
🌍 Country Configuration
SimpleLPR supports approximately 90 countries. Use --list-countries in the demo below to see all options.
Popular countries:
- 🇦🇹 Austria: 5
- 🇧🇷 Brazil: 12
- 🇨🇦 Canada: 16
- 🇫🇷 France: 32
- 🇩🇪 Germany: 34
- 🇮🇳 India: 41
- 🇮🇹 Italy: 45
- 🇪🇸 Spain: 82
- 🇬🇧 UK: 90
🎬 Complete Video Tracking Demo
This demo shows how to process video files or RTSP streams with real-time plate tracking:
#!/usr/bin/env python3
"""
SimpleLPR Video Tracking Demo
Track license plates across video frames with temporal correlation.
This improves accuracy by reducing transient misreads.
Usage:
python tracking_demo.py <video_source> <country_id> [product_key]
python tracking_demo.py --list-countries
Examples:
python tracking_demo.py traffic.mp4 82
python tracking_demo.py rtsp://camera:554/stream 90 license.xml
"""
import sys
import os
import argparse
import time
from datetime import datetime
from collections import deque
try:
import simplelpr
except ImportError:
print("❌ Error: SimpleLPR is not installed. Run 'pip install SimpleLPR'")
sys.exit(1)
def list_supported_countries():
"""Display all supported countries"""
print("\n🌍 SimpleLPR - Supported Countries")
print("="*50)
setup_params = simplelpr.EngineSetupParms()
engine = simplelpr.SimpleLPR(setup_params)
# Show version
ver = engine.versionNumber
print(f"📌 Version: {ver.A}.{ver.B}.{ver.C}.{ver.D}\n")
print("ID : Country")
print("-"*30)
for i in range(engine.numSupportedCountries):
print(f"{i:3d} : {engine.get_countryCode(i)}")
print("\n💡 Use either the country name or ID as the country_id parameter.")
def configure_country(engine, country_id):
"""Configure engine for specific country"""
# Disable all countries first
for i in range(engine.numSupportedCountries):
engine.set_countryWeight(i, 0.0)
# Try as string first, then as integer
country_name = None
if isinstance(country_id, str):
try:
engine.set_countryWeight(country_id, 1.0)
country_name = country_id
except:
# Try as integer
try:
country_idx = int(country_id)
if 0 <= country_idx < engine.numSupportedCountries:
engine.set_countryWeight(country_idx, 1.0)
country_name = engine.get_countryCode(country_idx)
else:
raise ValueError(f"Country ID {country_idx} out of range")
except ValueError:
print(f"\n❌ Error: Invalid country '{country_id}'")
print("💡 Run with --list-countries to see valid options")
sys.exit(1)
else:
# Integer country ID
engine.set_countryWeight(country_id, 1.0)
country_name = engine.get_countryCode(country_id)
engine.realizeCountryWeights()
return country_name
def process_tracker_result(tracker_result, track_count):
"""Process and display tracker results"""
# Process new tracks
for track in tracker_result.newTracks:
track_count += 1
if track.representativeCandidate.matches:
match = track.representativeCandidate.matches[0]
print(f"🆕 [NEW #{track_count:03d}] {match.text:12} "
f"Country: {match.country} "
f"Confidence: {match.confidence:.3f} "
f"Frame: {track.firstDetectionFrameId}")
# Process closed tracks
for track in tracker_result.closedTracks:
if track.representativeCandidate.matches:
match = track.representativeCandidate.matches[0]
duration = (track.newestDetectionTimestamp -
track.firstDetectionTimestamp)
frames = (track.newestDetectionFrameId -
track.firstDetectionFrameId + 1)
print(f"✅ [CLOSED] {match.text:12} "
f"Duration: {duration:.1f}s ({frames} frames)")
return track_count
def process_pending_results(proc_pool, tracker, frame_queue, track_count):
"""Process all pending results from the pool"""
while True:
result = proc_pool.pollNextResult(0, simplelpr.TIMEOUT_IMMEDIATE)
if result is None:
break
if frame_queue:
orig_frame = frame_queue.popleft()
tracker_result = tracker.processFrameCandidates(
result, orig_frame
)
track_count = process_tracker_result(tracker_result, track_count)
return track_count
def process_video(video_path, country_id, product_key=None):
"""Main video processing function"""
print("\n🚗 SimpleLPR Video Tracking Demo")
print("="*50)
# Initialize engine
setup_params = simplelpr.EngineSetupParms()
setup_params.maxConcurrentImageProcessingOps = 0 # Let the ANPR engine decide
engine = simplelpr.SimpleLPR(setup_params)
# Show version
ver = engine.versionNumber
print(f"📌 Version: {ver.A}.{ver.B}.{ver.C}.{ver.D}")
# Load product key if provided
if product_key:
try:
engine.set_productKey(product_key)
print("🔑 Product key loaded")
except:
print("⚠️ Warning: Failed to load product key")
else:
print("🔓 Running in evaluation mode")
# Configure country
country_name = configure_country(engine, country_id)
print(f"🌍 Country: {country_name}")
# Create processor pool
proc_pool = engine.createProcessorPool(3) # 3 processors in the pool
proc_pool.plateRegionDetectionEnabled = True
# Create tracker
tracker_params = simplelpr.PlateCandidateTrackerSetupParms()
tracker = engine.createPlateCandidateTracker(tracker_params)
print(f"🔄 Tracker: {tracker_params.minTriggerFrameCount} min frames, "
f"{tracker_params.maxIdleTimeInSec}s max idle")
# Open video
print(f"\n📹 Opening: {video_path}")
video = engine.openVideoSource(
video_path,
simplelpr.FrameFormat.FRAME_FORMAT_BGR24,
1920, 1080 # Max resolution
)
if video.state != simplelpr.VideoSourceState.VIDEO_SOURCE_STATE_OPEN:
print(f"❌ Error: Failed to open video (state: {video.state})")
sys.exit(1)
print(f"📡 Type: {'Live stream' if video.isLiveSource else 'Video file'}")
print("\n▶️ Processing... Press Ctrl+C to stop\n")
# Processing variables
frame_queue = deque()
frame_count = 0
track_count = 0
start_time = time.time()
try:
# Main processing loop
while True:
# Get next frame
frame = video.nextFrame()
if frame is None:
if video.isLiveSource:
print("🔄 Stream interrupted, reconnecting...")
video.reconnect()
time.sleep(0.1)
continue
else:
break # End of file
frame_count += 1
frame_queue.append(frame)
# Submit for processing
success = proc_pool.launchAnalyze(
0, # Stream ID
frame.sequenceNumber,
simplelpr.TIMEOUT_INFINITE,
frame
)
if not success:
frame_queue.pop()
continue
# Process all available results
track_count = process_pending_results(
proc_pool, tracker, frame_queue, track_count
)
# Progress update
if frame_count % 100 == 0:
elapsed = time.time() - start_time
fps = frame_count / elapsed
print(f"📊 [Progress] {frame_count} frames @ {fps:.1f} fps")
# Process remaining results
print("\n⏳ Finalizing...")
while proc_pool.ongoingRequestCount_get(0) > 0:
result = proc_pool.pollNextResult(0, 100) # 100ms timeout
if result and frame_queue:
orig_frame = frame_queue.popleft()
tracker_result = tracker.processFrameCandidates(
result, orig_frame
)
track_count = process_tracker_result(tracker_result, track_count)
# Final tracker flush
final_result = tracker.flush()
for track in final_result.closedTracks:
if track.representativeCandidate.matches:
match = track.representativeCandidate.matches[0]
print(f"📍 [FINAL] {match.text}")
except KeyboardInterrupt:
print("\n\n⚠️ Stopped by user")
# Statistics
elapsed = time.time() - start_time
print(f"\n{'='*50}")
print(f"✅ Processing Complete!")
print(f"📊 Frames processed: {frame_count:,}")
print(f"🚗 Plates tracked: {track_count}")
print(f"⏱️ Processing time: {elapsed:.1f}s")
print(f"⚡ Average speed: {frame_count/elapsed:.1f} fps")
def main():
parser = argparse.ArgumentParser(
description="SimpleLPR Video Tracking Demo",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
📝 Examples:
%(prog)s traffic.mp4 82 # Spain
%(prog)s video.avi France # Using country name
%(prog)s rtsp://camera:554 90 key.xml # UK with license
💡 Tips:
- Use --list-countries to see all supported regions
- Country can be specified by name or ID number
- RTSP streams will reconnect automatically
"""
)
parser.add_argument("video_source", nargs='?',
help="Video file path or RTSP stream URL")
parser.add_argument("country_id", nargs='?',
help="Country name (e.g., 'Spain') or ID (0-102)")
parser.add_argument("product_key", nargs='?',
help="License key file path (optional)")
parser.add_argument("--list-countries", action="store_true",
help="Show all supported countries and exit")
args = parser.parse_args()
if args.list_countries:
list_supported_countries()
return
if not args.video_source or not args.country_id:
parser.print_help()
print("\n💡 Tip: Use --list-countries to see supported regions")
sys.exit(1)
# Process video
process_video(args.video_source, args.country_id, args.product_key)
if __name__ == "__main__":
main()
🔧 Key Concepts
🔄 Processor Pools
Enable concurrent processing of multiple frames for better throughput:
pool = engine.createProcessorPool(3) # 3 parallel processors
pool.plateRegionDetectionEnabled = True # Better accuracy
🎯 Plate Tracking
The tracker correlates detections across frames, eliminating transient misreads:
tracker_params = simplelpr.PlateCandidateTrackerSetupParms()
tracker_params.minTriggerFrameCount = 3 # Frames needed to confirm
tracker_params.maxIdleTimeInSec = 2.0 # Time before closing track
tracker = engine.createPlateCandidateTracker(tracker_params)
📹 Video Sources
SimpleLPR handles both files and live streams transparently:
# Video file
video = engine.openVideoSource("traffic.mp4", ...)
# RTSP stream
video = engine.openVideoSource("rtsp://camera:554/stream", ...)
# Auto-reconnect for streams
if video.isLiveSource:
video.reconnect()
🏗️ Architecture
SimpleLPR employs a multi-stage processing pipeline:
- 🖼️ Image Preprocessing: Noise reduction, contrast enhancement
- 🔍 Plate Detection: Locate potential plate regions
- 📐 Perspective Correction: Transform skewed plates to frontal view
- ✂️ Character Segmentation: Identify individual character boundaries
- 🔤 OCR Recognition: Classify characters using specialized neural networks
- ✅ Format Validation: Match against country-specific templates
- 🔄 Tracking: Correlate detections across frames for consistency
💡 Common Use Cases
🅿️ Parking Management
- Entry/exit gate control
- Space occupancy monitoring
- Permit verification
- Duration tracking
🛣️ Toll Collection
- High-speed highway processing
- Multi-lane free-flow systems
- Violation enforcement
🚨 Security & Access Control
- Gated community entry
- Corporate campus security
- VIP list verification
- Visitor management
📊 Analytics & Smart City
- Traffic flow analysis
- Journey time calculation
- Congestion monitoring
- Environmental zone enforcement
📚 Documentation
- 📖 User Guide - Complete documentation
- 🐍 Python API Reference - Detailed API docs
- 🚀 Python Quick Start - Get started fast
- 💻 GitHub Examples - More sample code
🤝 Support
- 📧 Email: support@warelogic.com
- 🌐 Website: https://www.warelogic.com
📄 License
SimpleLPR is commercial software with a 60-day evaluation period. Production licenses include:
- ✅ One-time payment - no recurring fees
- ✅ Unlimited deployments
- ✅ Royalty-free redistribution
- ✅ 1 year of updates and support
Contact support@warelogic.com for pricing.
🚗 SimpleLPR - Professional license plate recognition for Python developers
Metadata
Release files for SimpleLPR 3.6.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 1.0 GB
Release files / simplelpr-3.6.4.1-cp314-cp314-win_amd64.whl
| Download URL | simplelpr-3.6.4.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 72.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d50b35db11444b9ea6d9c5ff2167824d663086fd81a14d612fcf1e06f651024b
|
|
BLAKE2b-256 checksum How to use checksums |
9e4d5612c23d9f17d7ea5edf6393169a1ab138383bd1bef507e3e3a4d8b8bc56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp314-cp314-manylinux_2_31_x86_64.whl
| Download URL | simplelpr-3.6.4.1-cp314-cp314-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 135.6 MB |
| Tags | CPython 3.14 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
bc91944017e29d120780bd58c12d1facef8547ed911dd92432b99d31ebcb0fcf
|
|
BLAKE2b-256 checksum How to use checksums |
23fa2e655b72eaadb1d3a02822d9344615449a8b4a5ecd0461569c4f853510c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp313-cp313-win_amd64.whl
| Download URL | simplelpr-3.6.4.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 72.4 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6e7ff5bc6490b13768fe388468c7cf678db4220e808b51fe70acb982505fe565
|
|
BLAKE2b-256 checksum How to use checksums |
61564b4d56beb8349516511dfc82574d5f8acf9cbeeeb629f95ce50e27e88ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp313-cp313-manylinux_2_31_x86_64.whl
| Download URL | simplelpr-3.6.4.1-cp313-cp313-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 135.6 MB |
| Tags | CPython 3.13 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
82af19d411bfa5bc3569345f45ed6a2a3768aebc5811865f578afbda147efc1f
|
|
BLAKE2b-256 checksum How to use checksums |
77b788e8c1c881d6545e65f2af593ebbcbf5fac24201d3c9a46336395d8c5919
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp312-cp312-win_amd64.whl
| Download URL | simplelpr-3.6.4.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 72.4 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e2a8e5d1df9397d37aa40c73bed1ec59c3f109915e4e0b63a635b9cc2369c42f
|
|
BLAKE2b-256 checksum How to use checksums |
0c9f7952ed7f107e739981f2a2607761766d6904b76b1e50cde55a524fb60655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp312-cp312-manylinux_2_31_x86_64.whl
| Download URL | simplelpr-3.6.4.1-cp312-cp312-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 135.6 MB |
| Tags | CPython 3.12 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
b13a15d0be3fb0375de9b4970865d15404ab4e2c8466136f91117965ffbff571
|
|
BLAKE2b-256 checksum How to use checksums |
a974f8c159faed421a8e7f19d27548f4b14aa411b4fcec1a739ed772d24d5e5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp311-cp311-win_amd64.whl
| Download URL | simplelpr-3.6.4.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 72.4 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
900025f0b7f58c15e0c35e62957d330fa01e57ab5809fa44a90f5524ebcfcf00
|
|
BLAKE2b-256 checksum How to use checksums |
b4956fc81094cfc41abe77f774f86a72a85f584bccf2a4d0457a500fad6344b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp311-cp311-manylinux_2_31_x86_64.whl
| Download URL | simplelpr-3.6.4.1-cp311-cp311-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 135.6 MB |
| Tags | CPython 3.11 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
cd6a096fbe1499823692ecb56bd2745c71ea3f480c5383ec5ac6ffe3661e5b4e
|
|
BLAKE2b-256 checksum How to use checksums |
4d40386a3f6ccac069b3315a6170cc8438d68ccd61faf75cea2e9a0e1d7cc70a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp310-cp310-win_amd64.whl
| Download URL | simplelpr-3.6.4.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 72.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6b0f079c0c423f3b81f4368fce1c1d9142f7fe61022cc70fec434f159fc719de
|
|
BLAKE2b-256 checksum How to use checksums |
df9aa127e5ae7901ab29cf8aa6782903626bc456d3d647563a367806fbc1fd24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / simplelpr-3.6.4.1-cp310-cp310-manylinux_2_31_x86_64.whl
| Download URL | simplelpr-3.6.4.1-cp310-cp310-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 135.6 MB |
| Tags | CPython 3.10 Linux glibc 2.31+ x86-64 |
|
SHA-256 checksum How to use checksums |
74fd82b312d9fa3917a2f4409b64b2255334d57601a30d486ad4240b1e33faac
|
|
BLAKE2b-256 checksum How to use checksums |
e00a76b9e3f90a073ebf2a29deb524ac487991d27458054f1ee8c5f26f153230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for SimpleLPR 3.6.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.