CN115713756A - Method for improving accurate positioning of license plate - Google Patents
Method for improving accurate positioning of license plate Download PDFInfo
- Publication number
- CN115713756A CN115713756A CN202110958705.4A CN202110958705A CN115713756A CN 115713756 A CN115713756 A CN 115713756A CN 202110958705 A CN202110958705 A CN 202110958705A CN 115713756 A CN115713756 A CN 115713756A
- Authority
- CN
- China
- Prior art keywords
- license plate
- detection
- model
- license
- positioning
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Traffic Control Systems (AREA)
Abstract
The invention provides a method for improving license plate accurate positioning, which is characterized in that an OCR detection model is applied to detect a license plate, a heat map is adopted as a network output result to detect the license plate, the license plate positioning is determined through a license plate key point model, the model quantization is carried out to low bit, and the license plate detection and license plate positioning is realized. The method comprises the steps of obtaining data from the beginning, loading the data into a license plate detection model, further judging whether a license plate can be detected or not, and ending the detection if the license plate cannot be detected; if the license plate can be detected, entering a license plate key point model, performing perspective transformation to correct the license plate and outputting, and finally finishing the detection. The license plate detection and positioning are more accurate, and the quantification difficulty is reduced.
Description
Technical Field
The invention relates to the technical field of intelligent image processing, in particular to a method for improving accurate positioning of a license plate.
Background
With the development of computer technology and the widespread application of computer vision principles, the use of computer image processing technology to detect tracked objects in real time is becoming more and more popular. The dynamic real-time tracking and positioning of the target are used in intelligent transportation systems, intelligent monitoring systems and military target detection, and the positioning of surgical instruments in medical navigation surgery has wide application value. The task of object detection is to find all interested objects in the image, determine their positions and sizes, and is one of the core problems in the field of machine vision. Because various objects have different appearances, shapes and postures, and interference of factors such as illumination, shielding and the like during imaging is added, target detection is always the most challenging problem in the field of machine vision.
In the prior art, a license plate recognition system is a technology capable of monitoring vehicles on a road surface and automatically extracting and processing license plate information of the vehicles, and when the vehicles enter a snapshot area of the license plate recognition system, a license plate recognition all-in-one machine is triggered to snapshot images of the vehicles and automatically recognize license plate numbers. The vehicle detector mainly plays a role in triggering, and the license plate recognition all-in-one machine is started for monitoring and snapshot after triggering, so that the license plate recognition all-in-one machine is prevented from being in a starting state all the time. At present, license plate detection systems are mostly used at barrier gate openings, and the applied scene is a parking scene at the edge of a roadside. In such a scene, the deformation degree of the acquired picture license plate is large when the camera is positioned on the roadside.
At present, the traditional license plate detection directly returns 4 coordinate points, the difficulty is high, and the returning points are not accurate. And the regression coordinate point is not easy to quantize (the model is from a floating point to 8bit, 4bit and 2 bit), the precision of the low-bit model is reduced, and the regression point is inaccurate. The difficulty of direct regression of the model to the coordinates is increased and is not easy to quantify. Inaccurate regression points can affect the license plate recognition effect.
In addition, the common terminology in the prior art is as follows:
ocr (Optical Character Recognition) refers to a process in which an electronic device (e.g., a scanner or a digital camera) examines a printed Character on paper, determines its shape by detecting dark and light patterns, and then translates the shape into computer text using a Character Recognition method.
OCR detection: the position of the word is detected.
Disclosure of Invention
To the inaccurate, difficult problem of quantization of traditional license plate detection regression point, the aim at of this application lies in: by providing the method for accurately positioning the license plate in the license plate detection system and reducing the quantization difficulty, the license plate detection is trained and the precision is improved.
The method comprises the steps of detecting the license plate by applying an OCR detection model, detecting the license plate by adopting a heat map as a network output result, determining the license plate location through a license plate key point model, quantizing the model to low bits, and realizing license plate detection and license plate location.
The method comprises the steps of obtaining data from the beginning, loading the data into a license plate detection model, further judging whether a license plate can be detected or not, and ending the detection if the license plate cannot be detected; if the license plate can be detected, entering a license plate key point model, performing perspective transformation to correct the license plate and outputting, and finally finishing the detection.
The method further comprises the steps of:
s1, license plate data making:
the license plate is marked as four angular points of the license plate, data enhancement is enhanced, perspective transformation is adopted, and angular rotation is simultaneously carried out on three axes of xyz respectively, so that the condition that a roadside camera shoots is achieved, namely the camera is placed at one of four corners of a roadside parking space, and the camera position is not much different from the height of the license plate or the position with the same height, and the license plate shot by the camera has a large angle, as shown in figure 1;
s2, training a license plate detection model:
the method for detecting the license plate by adopting the segmentation in the OCR detection comprises the following steps: firstly, outputting a text (license plate) segmentation result heat map (namely a probability map, wherein each pixel is the probability of whether a positive sample exists) of the picture through a DBNet network (using ResNet-18+ FPN), converting the segmentation result map into a binary map by using a preset threshold, wherein the threshold is 0.3, and finally finding out the outline of the license plate and framing the license plate. The process is shown in FIG. 2;
wherein, the existing function exists in the contour finding in the specific method in OCR detection, which is used here as cv2.FindContours function, resNet-18 is a classic network, FPN is a network structure, which can be embodied in FIG. 2;
s3, license plate key point training:
a license plate key point model is required to be added after the license plate is detected, the model uses an 8-layer CNN convolution network, four corner points of the license plate are output as a result, the four corner points are positioned, the 4 points are used for carrying out perspective transformation on the picture, the perspective transformation can adopt the existing function, the license plate is corrected by using a cv2.Warp perspective function, and the license plate is convenient to recognize.
The model trained in the step S2 is suitable for license plates under the roadside camera, license plates with serious exposure at night, license plates with dark brightness and inclined license plates.
The detection model used in the method is a DBNet framework applied to OCR detection, and the model result is a heat map.
According to the method, the application scene of license plate detection is a roadside scene, and the position of a camera for acquiring image data is low, so that the deformation degree of the shape of the license plate is large.
The method may further comprise:
s4, model quantification:
the license plate vehicle inspection model is quantized to 4bit, and the precision is not lost; since the key points need to be accurately positioned, and then since the key point model is small, the quantization is 8 bits, and the quantization is lossless. The quantization can be directly performed by the quantization method in the prior art, and the quantization is performed by a quantization platform which is self-developed by Beijing Junzhen inheriting the circuit GmbH (short for Beijing Junzhen).
Thus, the present application has the advantages that:
by applying an OCR detection idea, the binary image is used as a network output result to detect the license plate and a license plate key point model is added, so that the license plate detection is more accurate in license plate positioning, and the quantification difficulty is reduced. High precision, low bit quantization, no loss of precision.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention.
FIG. 1 is a schematic diagram of a license plate detection result in a road side license plate scene in the application.
Fig. 2 is a schematic diagram of the entire network of the present application, and the FPN structure can be seen.
FIG. 3 is a schematic diagram of results of key points of a license plate in the method of the present application.
Fig. 4 is a schematic view of a vehicle detection flow in the method of the present application.
Fig. 5 is a flow chart of the main steps of the method of the present application.
Detailed Description
In order that the technical contents and advantages of the present invention can be more clearly understood, the present invention will now be described in further detail with reference to the accompanying drawings.
The detection model used in the application is a modified version of the DBNet network applied to OCR detection. OCR detection is the detection of the location of a word and the use of a heat map (binary map) as the network output. This method with heatmaps is easy to quantify and is lossless. The license plate is composed of characters, so that the license plate can be detected by the method.
Specifically, the license plate is detected in an OCR detection mode, and accurate positioning is achieved through the key point model.
Further comprising, as shown in fig. 1-5, the method of the present invention relates to a method for improving the accurate positioning of a license plate, the method comprising the steps of:
s1, license plate data making:
the license plate is marked as four corner points of the license plate, the license plate has larger shape deformation degree because the application scene of the license plate detection is roadside, the position of the camera is low and the image color change from the camera is very large in order to avoid exposure condition, so that the data enhancement aspect needs to be strengthened, perspective transformation can be adopted, angle rotation is carried out on three axes of xyz, the situation of being shot by the roadside camera can be achieved after combination, and the generalization capability of the model is enhanced; the data is also enhanced in color so that the model can adapt to roadside scenes. The data enhancement mode is important, and can change limited data into required data and increase data diversity. The data is well made, and the training result of the same model is better.
S2, training a license plate detection model:
and (3) training the license plate by using an OCR detection model, so that the position of the license plate can be whitened and other places are black as a result of the model. And finding the outline of the license plate through post-processing, and framing the license plate. The trained model has good adaptability to license plates under a roadside camera, the recall rate can reach 97%, and the model has a poor effect on license plates with serious exposure, dark brightness and inclination at night, and some license plates with too inclination possibly have a poor effect, and the effect is shown in fig. 1;
s3, license plate key point training:
since the four corner points of the license plate cannot be accurately positioned in the license plate detection, the accuracy of license plate identification is affected, so that a license plate key point model is required to be added after the license plate is detected, the four corner points are positioned, and thus, the 4 points are used for carrying out perspective transformation on the picture, correcting the license plate and conveniently identifying the license plate, as shown in fig. 3;
s4, model quantification:
the license plate vehicle inspection model is quantized to 4bit, and the precision is not lost. Because the key points need to be accurately positioned, and then the key point model is very small, the quantization can be completed to 8 bits, and the quantization is lossless. The running time of the model after quantization is greatly reduced, and the model can be loaded on a board and run on a chip.
As shown in fig. 4, the image data is obtained from the beginning, the data is loaded to the license plate detection model, whether the license plate can be detected or not is further judged, and if the license plate cannot be detected, the detection is ended; if the license plate can be detected, entering a license plate key point model, performing perspective transformation to correct the license plate and outputting, and finally finishing the detection.
Thus, as shown in fig. 5, the main implementation steps of the method are as follows:
s1, license plate data making;
s2, training a license plate detection model;
and S3, training key points of the license plate.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. A method for improving accurate license plate positioning is characterized in that an OCR detection model is used for detecting license plates, a heat map is used as a network output result for detecting the license plates, license plate positioning is determined through a license plate key point model, model quantization is carried out to low bit, and license plate detection and license plate positioning are achieved.
2. The method for improving the accurate positioning of the license plate of claim 1, wherein the method obtains data from the beginning, loads the data into a license plate detection model, further judges whether the license plate can be detected, and ends the detection if the license plate cannot be detected; if the license plate can be detected, entering a license plate key point model, performing perspective transformation to correct the license plate and outputting, and finally finishing the detection.
3. The method for improving the accurate positioning of the license plate of claim 2, further comprising the steps of:
s1, license plate data making:
the license plate is marked as four angular points of the license plate, data enhancement is enhanced, perspective transformation is adopted, and angular rotation is simultaneously carried out on three axes of xyz respectively, so that the condition that a camera at the roadside shoots the license plate is achieved;
s2, training a license plate detection model:
detecting the license plate by adopting a segmentation method in OCR detection: firstly, outputting a text segmentation result heat map of a picture by a DBNet network, wherein the backbone uses ResNet-18+ FPN, converting the segmentation result map into a binary map by using a preset threshold, wherein the threshold is 0.3, and finally finding the outline of a license plate and framing the license plate;
s3, license plate key point training:
and after the license plate is detected, a license plate key point model is added, the model uses 8-layer CNN convolutional network, four corner points of the license plate are output as a result, the four corner points are positioned, and thus, the 4 points are used for carrying out perspective transformation on the picture, correcting the license plate and identifying the license plate.
4. The method according to claim 3, wherein the text of the output image in step S2 is a license plate, the segmentation result thermal image is a probability image, and each pixel is a probability of being a positive sample;
the ResNet-18 is a classical network, and the FPN is a network structure; in the process of finding the outline of the license plate, the existing function is adopted for finding the outline, and the function is cv2. FindContours;
the training license plate detection model is suitable for license plates under a roadside camera, license plates with serious exposure at night, license plates with dark brightness and inclined license plates.
5. The method of claim 1, wherein the detection model used in the method is a DBNet framework applied to OCR detection.
6. The method for improving the accurate positioning of the license plate according to claim 1, wherein the application scene of the license plate detection in the method is a roadside scene, and a camera for acquiring image data is low in position, so that the license plate has a large deformation degree.
7. The method for improving the accurate positioning of the license plate of claim 1, further comprising:
s4, model quantification:
the license plate vehicle inspection model is quantized to 4bit, and the precision is not lost; since the key points need to be accurately positioned, and then since the key point model is small, the quantization is 8 bits, and the quantization is lossless.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110958705.4A CN115713756A (en) | 2021-08-20 | 2021-08-20 | Method for improving accurate positioning of license plate |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110958705.4A CN115713756A (en) | 2021-08-20 | 2021-08-20 | Method for improving accurate positioning of license plate |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115713756A true CN115713756A (en) | 2023-02-24 |
Family
ID=85230098
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110958705.4A Pending CN115713756A (en) | 2021-08-20 | 2021-08-20 | Method for improving accurate positioning of license plate |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115713756A (en) |
-
2021
- 2021-08-20 CN CN202110958705.4A patent/CN115713756A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111862195B (en) | Light spot detection method and device, terminal and storage medium | |
CN109993086B (en) | Face detection method, device and system and terminal equipment | |
CN108229475B (en) | Vehicle tracking method, system, computer device and readable storage medium | |
US10999519B2 (en) | Target tracking method and device, movable platform, and storage medium | |
CN111144207B (en) | Human body detection and tracking method based on multi-mode information perception | |
CN111965636A (en) | Night target detection method based on millimeter wave radar and vision fusion | |
JP2000082144A (en) | Method for detection existence and direction of prescribed marker on document and system which is not affected by noise | |
CN111626941A (en) | Document correction method based on deep learning semantic segmentation | |
CN111652205B (en) | Text correction method, device, equipment and medium based on deep learning | |
CN114723677A (en) | Image defect detection method, image defect detection device, image defect detection equipment and storage medium | |
WO2021195873A1 (en) | Method and device for identifying region of interest in sfr test chart image, and medium | |
CN112419207A (en) | Image correction method, device and system | |
CN116542998B (en) | Contour detection method, device, equipment and medium for photoetching film inductance | |
CN115713756A (en) | Method for improving accurate positioning of license plate | |
US7702176B2 (en) | One dimensional feature enhancement | |
CN110796099A (en) | Vehicle overrun detection method and device | |
CN113378735B (en) | Road marking line identification method and device, electronic equipment and storage medium | |
CN112819738B (en) | Infrared image fusion method, device, computer equipment and storage medium | |
CN113223033A (en) | Poultry body temperature detection method, device and medium based on image fusion | |
CN112052859A (en) | License plate accurate positioning method and device in free scene | |
US10958899B2 (en) | Evaluation of dynamic ranges of imaging devices | |
CN118037610B (en) | Water gauge image distortion correction method and system for complex environment | |
JP2009098867A (en) | Character string recognition method, computer program and storage medium | |
CN110688999A (en) | Mach-band effect simulated point light source metal steel seal character detection method | |
US20240205558A1 (en) | Method and image-processing device for determining a lens distortion correction for an interchangeable camera lens |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |