API OCR C++ ฟรีสำหรับการจดจำป้ายทะเบียนอัตโนมัติ
OpenALPR เป็นไลบรารี OCR C++ แบบโอเพนซอร์สชั้นนำที่ช่วยให้นักพัฒนาซอฟต์แวร์สามารถฝังการจดจำป้ายทะเบียนอัตโนมัติและการจดจำยานพาหนะลงในแอป C++ ของตนเองได้.
OpenALPR คืออะไร?
OpenALPR เป็นไลบรารีการจดจำป้ายทะเบียนอัตโนมัติ (ALPR) แบบโอเพนซอร์สที่ทรงพลังออกแบบมาเพื่อตรวจจับและอ่านป้ายทะเบียนยานพาหนะจากภาพและวิดีโอ สร้างด้วย C++ และใช้ OCR (Optical Character Recognition) ผ่าน Tesseract ทำให้ OpenALPR สามารถผสานความสามารถการจดจำยานพาหนะเข้าไปในแอปพลิเคชันเพื่อระบบอัตโนมัติการจอดรถ ระบบรักษาความปลอดภัย จุดเก็บค่าผ่านทาง และโครงสร้างพื้นฐานเมืองอัจฉริยะ ไลบรารีนี้รวมฟีเจอร์หลายอย่างที่เกี่ยวกับการทำงานของ OCR เช่น การจดจำป้ายทะเบียนจากภาพและวิดีโอ, การจดจำป้ายทะเบียนจากฟีดกล้องสด, การสนับสนุนเทมเพลตป้ายตามภูมิภาค, การผสานเข้ากับแอปพลิเคชันแบบกำหนดเอง และอื่น ๆ อีกมากมาย
OpenALPR เป็นโซลูชันที่ยืดหยุ่นสูงพร้อมไบด์ดิ้งสำหรับภาษาโปรแกรมยอดนิยมอื่น ๆ เช่น C#, Java และ Python ทำให้เข้าถึงได้สำหรับนักพัฒนาหลากหลายประเภท ไลบรารีนี้มีทั้งเวอร์ชันโอเพนซอร์สและเวอร์ชันเชิงพาณิชย์ โดยเวอร์ชันโอเพนซอร์สเป็นที่นิยมในหมู่นักพัฒนาซอฟต์แวร์และผู้สนใจที่ต้องการทดลองเทคโนโลยี ALPR ไลบรารีออกแบบให้ทำงานข้ามแพลตฟอร์มและสามารถคอมไพล์และรันบน Linux, Windows และ macOS ไม่ว่าคุณจะสร้างระบบเก็บค่าผ่านทาง ระบบอัตโนมัติการจอดรถ หรือแพลตฟอร์มเฝ้าระวังการจราจร OpenALPR จะให้พื้นฐานที่เชื่อถือได้สำหรับการจดจำป้ายทะเบียนด้วยความแม่นยำ—โดยไม่ต้องพึ่งพาการทำงานบนคลาวด์
เริ่มต้นใช้งาน OpenALPR
วิธีที่แนะนำในการติดตั้ง OpenALPR คือการใช้ GitHub โปรดใช้คำสั่งต่อไปนี้เพื่อการติดตั้งที่ราบรื่น
Install OpenALPR API via GitHub
git clone https://github.com/openalpr/openalpr.git Install OpenALPR API via CMake
# Build with CMake
mkdir build
cd build
cmake ..
make
sudo make install
You can also install it manually; download the latest release files directly from GitHub repository.
จดจำป้ายทะเบียนจากภาพผ่าน API C++
The open source OpenALPR library has provided complete support for creating automatic license plate recognition system that uses OCR and computer vision to read vehicle registration plates from images and video streams. Software developers can use static images or real-time frames from a camera using OpenCV. The following code snippet demonstrates the basic workflow of using the OpenALPR C++ library. It initializes the library, recognizes a license plate from an image file, and then prints the results along with their confidence scores.
How to Detect License Plates from an Image using C++ API?
from openalpr import Alpr
alpr = Alpr("us", "/path/to/openalpr.conf", "/path/to/runtime_data")
if not alpr.is_loaded():
print("Error loading OpenALPR")
sys.exit(1)
results = alpr.recognize_file("/path/to/image.jpg")
i = 0
for plate in results['results']:
i += 1
print("Plate #%d" % i)
print(" %12s %12s" % ("Plate", "Confidence"))
for candidate in plate['candidates']:
prefix = "-"
if candidate['matches_template']:
prefix = "*"
print(" %s %12s%12f" % (prefix, candidate['plate'], candidate['confidence']))
# Call when completely done to release memory
alpr.unload()
การประมวลผลแบบเรียลไทม์และการจดจำยานพาหนะผ่าน C++
The open source OpenALPR library is optimized for performance and can process video streams in real-time, making it suitable for applications that require immediate feedback. Beyond just reading license plates, the OpenALPR library can also identify the make, model, and color of a vehicle, providing a more complete set of data for analysis.
การสนับสนุนการจดจำตามประเทศ
The OpenALPR library has included support for load and recognizing Country-Specific license plates inside C++ applications. The library has included license plates from over 60 countries, and it can even identify the issuing state for all 50 US states, as well as for Canada and Mexico.