How to Build a Java Spring Boot License Plate Recognition System with OpenCV

An open-source Java Spring Boot project demonstrates license plate detection and recognition using OpenCV, supporting multiple plate colors, with SVM and ANN training, detailed architecture, feature list, installation guide, and visual processing steps, offering a beginner-friendly tutorial for image recognition enthusiasts.

Programmer DD
Programmer DD
Programmer DD
How to Build a Java Spring Boot License Plate Recognition System with OpenCV

Gitee Open Source Repository

https://gitee.com/admin_yu/yx-image-recognition

Introduction

Spring Boot + Maven implementation of a license plate detection and training system.

Java-based deep learning project, rare in the open-source community; the original EasyPR-Java project hasn't been updated for five years.

References EasyPR C++ project and fan-wenjie’s EasyPR-Java, plus OpenCV 4.0.1 C++ source, to create this Java version.

Entry‑level tutorial; the author is still learning image recognition.

Added green‑plate detection; training data for green plates is limited and will be expanded.

Includes SVM‑based plate detection training and ANN‑based plate number recognition training.

Future plans include ID card and face recognition.

Features

Detection and recognition of yellow, blue, green, and mixed‑color plates.

Support for single image, batch image, concurrent processing, and multiple plates per image.

Plate detection training on images.

Text recognition training on images.

Two implementation options: using org.bytedeco.javacpp or the official org.opencv Java package.

Official OpenCV Java API can be referenced via build path or environment variables.

JavaCPP provides efficient native C++ access; add the Maven coordinates to the pom.

Software Versions

JDK 1.8.61+

Maven 3.0+

OpenCV 4.0.1, javacpp 1.4.4, opencv‑platform 4.0.1‑1.4.4

Spring Boot 2.1.5.RELEASE

yx-image-recognition 1.0.0

Architecture

B/S architecture: front‑end HTML + RequireJS, back‑end Java.

SQLite 3.0 database.

Swagger 2.0 for API documentation.

License Plate Detection Process

Gaussian blur

Grayscale conversion

Sobel operator

Binary thresholding

Morphological closing

Noise reduction on binary image

External contour extraction

Contour filtering

Image cropping

Resize cropped image

Detection result

License Plate Text Recognition Process

debug_char_threshold

debug_char_clearLiuDing

debug_specMat

debug_chineseMat

debug_char_auxRoi

Installation Guide

Set up development environment: ./doc/01_开发环境搭建.md

Clone the project locally and copy the PlateDetect folder to D:/PlateDetect; all operations default to that directory.

Modify paths in com/yuxue/constant/Constant.java as needed.

Run with Spring Boot and open http://localhost:16666/index in a browser.

Open http://localhost:16666/swagger‑ui.html for API documentation.

Reference Documents

EasyPR: https://gitee.com/easypr/EasyPR

EasyPR‑Java: https://github.com/fan-wenjie/EasyPR-Java

OpenCV official site: https://opencv.org/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

machine learningImage ProcessingSpring BootOpenCVlicense plate recognition
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.