CN114842285A - Roadside berth number identification method and device - Google Patents

Roadside berth number identification method and device Download PDF

Info

Publication number
CN114842285A
CN114842285A CN202210292187.1A CN202210292187A CN114842285A CN 114842285 A CN114842285 A CN 114842285A CN 202210292187 A CN202210292187 A CN 202210292187A CN 114842285 A CN114842285 A CN 114842285A
Authority
CN
China
Prior art keywords
character
roadside
berth number
berth
module
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
Application number
CN202210292187.1A
Other languages
Chinese (zh)
Inventor
闫军
丁丽珠
王艳清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Super Vision Technology Co Ltd
Original Assignee
Super Vision Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Super Vision Technology Co Ltd filed Critical Super Vision Technology Co Ltd
Priority to CN202210292187.1A priority Critical patent/CN114842285A/en
Publication of CN114842285A publication Critical patent/CN114842285A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/1465Aligning or centring of the image pick-up or image-field by locating a pattern
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Traffic Control Systems (AREA)

Abstract

The application discloses a method and a device for recognizing a roadside berth number. The method comprises the following steps: training a target detection model according to the multiple roadside berth number images to obtain a trained target detection model; detecting the roadside berth number image to be detected according to the trained target detection model to obtain character detection frame coordinate information and character category information of a plurality of berth number characters; obtaining the coordinate of the central point of each character detection frame according to the coordinate information of the character detection frame of each parking number character, and performing linear fitting according to the coordinate of each central point to obtain a fitted linear equation of each parking number character; according to each central point coordinate and each fitting linear equation, obtaining a grouping distance from each central point coordinate to each fitting linear equation, and grouping each central point coordinate to obtain a plurality of berth number groups; and sequencing according to the character category information and the central point coordinates of each parking number character to obtain a roadside parking number sequence.

Description

Roadside berth number identification method and device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a roadside berth number identification method and apparatus.
Background
Along with the development of 'internet + parking', wisdom parking relies on its high frequency, the just advantage that needs through the grasp to the big data of parkking, realizes parking intellectuality, management visualization and operation high efficiency, can provide value such as electronic payment, parking stall inquiry, parking stall reservation, parking stall navigation, peripheral information propelling movement and experience for the car owner. The intelligent parking system based on the internet technology, big data and cloud computing has many advantages, becomes a feasible scheme for rapidly solving the difficult problems of difficult parking, disorder parking and the like, and brings changes to parking and traveling of the whole city.
In the process of solving the difficult problems of difficult parking, disordered parking and the like, the key effect is played on the identification of the parking numbers on the road side. The traditional identification method detects key points of an image to be detected based on a key point detection positioning model, corrects the image according to the key points to obtain a corrected image, and identifies the corrected image based on a deep learning algorithm. However, the detection error of the key point is high, so that the identification accuracy of the traditional identification method is low, and the roadside parking charging management is not facilitated.
Content of application
The application aims to solve the technical problems that the traditional identification method is low in identification accuracy rate and not beneficial to roadside parking charge management. To achieve the above object, the present application provides a method
The application provides a roadside berth number identification method, which comprises the following steps:
acquiring a plurality of roadside berth number images, wherein each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters;
training and optimizing a target detection model according to the multiple roadside berth number images to obtain a trained target detection model;
detecting the roadside berth number image to be detected according to the trained target detection model to obtain character detection frame coordinate information and character category information of a plurality of berth number characters;
obtaining the coordinate of the central point of each character detection frame according to the coordinate information of the character detection frame of each parking number character, and performing linear fitting according to the coordinate of each central point to obtain a fitted linear equation of each parking number character;
according to each central point coordinate and each fitted linear equation, obtaining a grouping distance from each central point coordinate to each fitted linear equation, and grouping each central point coordinate according to each grouping distance to obtain a plurality of berth number groups;
and sequencing according to the character category information and the central point coordinates of each parking number character in each parking number group to obtain a roadside parking number sequence.
In one embodiment, before the obtaining the center point coordinates of each of the character detection boxes according to the character detection box coordinate information of each of the parking number characters, performing straight line fitting according to each of the center point coordinates to obtain a fitted straight line equation of each of the parking number characters, obtaining the grouping distance between each of the center point coordinates and each of the fitted straight line equations according to each of the center point coordinates and each of the fitted straight line equations, and grouping each of the center point coordinates according to each of the grouping distances to obtain a plurality of parking number groups, the method further includes:
calculating a slope difference value according to the slopes of any two fitting linear equations, and judging whether the slope difference value is smaller than a first threshold value;
if the slope difference value is smaller than the first threshold value, calculating an intercept difference value according to the intercept of the two fitted linear equations, and judging whether the intercept difference value is smaller than a second threshold value;
if the intercept difference is smaller than the second threshold, calculating the slope average value and the intercept average value of the two fitted linear equations;
and obtaining a new fitted linear equation according to the slope average value and the intercept average value, and replacing the two fitted linear equations with the new fitted linear equation to obtain the new fitted linear equation corresponding to the berth number character.
In one embodiment, the method further comprises:
if the slope difference value is larger than the first threshold value, the two fitted linear equations are two independent straight lines;
if the intercept difference is greater than the second threshold, the two fitted linear equations are two independent straight lines;
wherein the first threshold is in the range of 3 to 7 and the second threshold is in the range of 17 to 24.
In one embodiment, the grouping each of the center point coordinates according to each of the grouping distances to obtain a plurality of groups of berth numbers includes:
judging whether each grouping distance is smaller than a third threshold value;
if the grouping distance is smaller than the third threshold, dividing the center point coordinates corresponding to the grouping distance into the same group;
forming each berth number group according to the berth number character corresponding to each central point coordinate in the same group;
wherein the third threshold is in a range of 75 to 85.
In one embodiment, the obtaining a roadside parking number code sequence by sorting according to the character category information and the center point coordinates of each parking number character in each parking number group includes:
and performing ascending arrangement according to the character category information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate to obtain the roadside parking number code sequence.
In one embodiment, the training and optimizing the target detection model according to the multiple roadside berth number images to obtain a trained target detection model includes:
inputting the roadside berth number images into a target detection model, and outputting the coordinate information of a predicted character detection frame and the category information of predicted characters of each berth number character;
and constructing a loss function according to the real character detection frame coordinate information, the real character category information, the predicted character position information and the predicted character category information, and performing training optimization on the target detection model according to the loss function to obtain a trained target detection model.
In one embodiment, the present application provides a roadside berth number identification device, comprising:
the system comprises a data acquisition module, a data processing module and a data processing module, wherein the data acquisition module is used for acquiring a plurality of roadside berth number images, and each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters;
the model generation module is used for training and optimizing a target detection model according to the multiple roadside berth number images to obtain a trained target detection model;
the character information acquisition module is used for detecting the roadside berth number image to be detected according to the trained target detection model to acquire character detection frame coordinate information and character category information of a plurality of berth number characters;
the fitting linear equation acquisition module is used for acquiring the central point coordinate of each character detection frame according to the character detection frame coordinate information of each parking number character, and performing linear fitting according to each central point coordinate to acquire a fitting linear equation of each parking number character;
the grouping module is used for acquiring the grouping distance from each central point coordinate to each fitting linear equation according to each central point coordinate and each fitting linear equation, and grouping each central point coordinate according to each grouping distance to obtain a plurality of berth number groups;
and the roadside parking number code sequence generating module is used for sequencing according to the character category information and the central point coordinates of each parking number character in each parking number group to obtain a roadside parking number code sequence.
In one embodiment, the roadside berth number identification device further comprises:
the first judgment module is used for calculating a slope difference value according to the slopes of any two fitting linear equations and judging whether the slope difference value is smaller than a first threshold value or not;
the second judgment module is used for calculating an intercept difference value according to the intercept of the two fitted linear equations and judging whether the intercept difference value is smaller than a second threshold value if the slope difference value is smaller than the first threshold value;
the average value obtaining module is used for calculating the slope average value and the intercept average value of the two fitted linear equations if the intercept difference value is smaller than the second threshold value;
and the new fitting linear equation obtaining module is used for obtaining a new fitting linear equation according to the slope average value and the intercept average value, replacing the two fitting linear equations with the new fitting linear equation, and obtaining the new fitting linear equation corresponding to the berth number character.
In one embodiment, the roadside berth number identification device further comprises:
the third judging module is used for judging that the two fitted linear equations are two independent lines if the slope difference value is larger than the first threshold value;
the fourth judgment module is used for judging that the two fitted linear equations are two independent straight lines if the intercept difference value is larger than the second threshold value;
wherein the first threshold is in the range of 3 to 7 and the second threshold is in the range of 17 to 24.
In one embodiment, the grouping module comprises:
a fifth judging module, configured to judge whether each of the grouping distances is smaller than a third threshold;
a central point coordinate dividing module, configured to divide the central point coordinates corresponding to the grouping distances into the same group if the grouping distance is smaller than the third threshold;
the berth number group forming module is used for forming each berth number group according to the berth number character corresponding to each central point coordinate in the same group;
wherein the third threshold is in a range of 75 to 85.
In one embodiment, the roadside berthing number sequence generating module includes:
and the sequencing module is used for performing ascending sequence arrangement according to the character type information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate to obtain the roadside parking number code sequence.
In one embodiment, the model generation module comprises:
the target detection model construction module is used for inputting the roadside berth number images into a target detection model and outputting the coordinate information of a predicted character detection frame and the category information of predicted characters of each berth number character;
and the training optimization module is used for constructing a loss function according to the real character detection frame coordinate information, the real character category information, the predicted character position information and the predicted character category information, and training and optimizing the target detection model according to the loss function to obtain a trained target detection model.
In the method and the device for recognizing the roadside berth numbers, the target detection model is trained and optimized based on the multiple roadside berth number images, and the trained target detection model is obtained. And detecting the roadside berth number image to be detected according to the trained target detection model to obtain the character detection frame coordinate information and the character category information of the corresponding berth number characters. And then, sequentially obtaining the coordinates of the central point, the fitting linear equation and the grouping distance according to the coordinate information of the character detection frame. Therefore, grouping is carried out according to the one-to-one correspondence among the coordinates of the central point, the fitted linear equation and the grouping distance, and the grouping is divided into a plurality of berth number groups. And in each parking number group, acquiring a corresponding roadside parking number code sequence according to the character type information and the center point coordinates of the parking number characters. By the roadside berth number identification method, model training and parameter optimization are carried out on the target detection model, the trained target detection model is obtained, linear fitting, berth number grouping and berth sequence generation are carried out on the basis of the output result of the trained target detection model, and a final berth number code sequence is obtained. By the roadside berth number identification method, multi-level identification and screening can be performed on the output result of the trained target detection model, the identification accuracy is improved, real-time accurate identification can be performed, and the accuracy of roadside parking charge management by using the mobile inspection vehicle is improved.
Drawings
Fig. 1 is a schematic step flow diagram of a roadside berth number identification method provided in the present application.
Fig. 2 is a schematic structural diagram of a roadside berth number identification device provided by the present application.
Detailed Description
The technical solution of the present application is further described in detail by the accompanying drawings and examples.
Referring to fig. 1, the present application provides a roadside berth number identification method, including:
s10, acquiring a plurality of roadside berth number images, wherein each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters;
s20, training and optimizing the target detection model according to the multiple roadside parking number images to obtain a trained target detection model;
s30, detecting the roadside berth number image to be detected according to the trained target detection model to obtain character detection frame coordinate information and character category information of a plurality of berth number characters;
s40, obtaining the center point coordinate of each character detection frame according to the character detection frame coordinate information of each parking number character, and performing straight line fitting according to each center point coordinate to obtain a fitting straight line equation of each parking number character;
s50, obtaining the grouping distance from each central point coordinate to each fitting linear equation according to each central point coordinate and each fitting linear equation, and grouping each central point coordinate according to each grouping distance to obtain a plurality of berth number groups;
s60, sorting according to the character category information and the center point coordinates of each parking number character in each parking number group, and obtaining a roadside parking number sequence.
In S10, each roadside berth number image includes a roadside berth number. Each roadside parking number includes a plurality of parking number characters. Roadside berth numbers may be understood as numbers representing berth positions printed alongside the berth. The roadside berth number images can be acquired by collecting roadside berth number data by using a camera on the mobile inspection equipment. The mobile inspection equipment generally comprises three cameras which face to the front side, the right side and the rear side of the traveling direction of the inspection equipment respectively. Three cameras of the mobile inspection equipment are respectively used for acquiring front video data of the advancing direction, right parking space video information and rear video data of the advancing direction. The camera towards the right side in the mobile inspection equipment can shoot a clear and complete roadside berth number, video data shot by the camera at the right side is collected, and an image frame containing the roadside berth number is extracted to serve as a roadside berth number image.
Each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters. The real character detection frame coordinate information and the real character category information of each berth number character can be acquired through data marking. In one embodiment, a rectangular box labeling tool is used for target detection labeling of all the parking number characters in each roadside parking number image. The character detection box coordinate information includes coordinate position information of the upper left corner and the lower right corner of the parking number character. The character category information includes 11 categories of arabic numerals 0 to 9 and a character "-".
At S20, the plurality of roadside berth number images form a training set of target detection models. Inputting the multiple roadside berth number images into the target detection model for berth number character target detection, and obtaining target detection results of all berth number characters of each roadside berth number image. And training and optimizing the target detection model through a data training set formed by the roadside berth number images to form a trained target detection model for predicting the roadside berth number image to be detected. The target detection model may be formed for a convolutional neural network, a two-stage or a single-stage target detection method.
In S30, the roadside parking number image to be detected may be understood as the roadside parking number image to be detected that needs to be detected. And inputting the roadside berth number image to be detected to the trained target detection model, and correspondingly outputting the character detection frame coordinate information and the character category information of each berth number character.
In S40, the character detection box coordinate information may represent coordinate information of the character outline, and specifically may be upper-left corner and lower-right corner coordinate position information of the parking number character. And calculating the coordinates of the center point of each character detection frame according to the coordinate information of the character detection frame. The center point coordinates may be represented as (x, y). And fitting a corresponding fitted linear equation according to the coordinates of the central point. The fitting method can be Hough transform algorithm, least square method or RANSAC algorithm, etc. Performing straight line fitting on each central point coordinate according to Hough transform algorithm, least square method or RANSAC algorithm to obtain two-point coordinates (x) representing straight line after fitting 1 ,y 1 ,x 2 ,y 2 ). According to two point coordinates (x) 1 ,y 1 ,x 2 ,y 2 ) The corresponding fitted straight-line equation y may be obtained as kx + b.
In S50, the grouping distance may be understood as a distance from each center point coordinate to each fitted straight line equation, and may be calculated by a point-to-straight line distance calculation formula. One grouping distance corresponds to one central point coordinate, corresponds to one fitting linear equation and corresponds to one berth number character. Through dividing the grouping distance, the division of the coordinates of the central point can be realized, and then the division of the fitted linear equation can be realized, so that the division of the characters of the berth number can be realized, and a plurality of berth number groups are formed.
In S60, after training the target detection model through the character type information data set labeled in the roadside berth number images, the trained target detection model is obtained. And detecting the roadside berth number image to be detected through the trained target detection model to obtain character category information. The center point coordinate comprises X-axis coordinate information and Y-axis coordinate information. And sequencing each parking number character can be realized according to the X-axis coordinate information and the Y-axis coordinate information. And obtaining a corresponding roadside parking number code sequence in each parking number group according to the sequencing of the parking number characters.
The roadside berth number identification method provided by the application performs target detection model training optimization based on a plurality of roadside berth number images to obtain a trained target detection model. And detecting the roadside berth number image to be detected according to the trained target detection model to obtain the character detection frame coordinate information and the character category information of the corresponding berth number characters. And then, sequentially obtaining the coordinates of the central point, the fitted linear equation and the grouping distance according to the coordinate information of the character detection frame. Therefore, grouping is carried out according to the one-to-one correspondence among the coordinates of the central point, the fitted linear equation and the grouping distance, and the grouping is divided into a plurality of berth number groups. And in each parking number group, acquiring a corresponding roadside parking number code sequence according to the character type information and the center point coordinates of the parking number characters. By the roadside berth number identification method, model training and parameter optimization are carried out on the target detection model, the trained target detection model is obtained, linear fitting, berth number grouping and berth sequence generation are carried out on the basis of the output result of the trained target detection model, and a final berth number code sequence is obtained. By the roadside berth number identification method, multi-level identification and screening can be performed on the output result of the trained target detection model, the identification accuracy is improved, real-time accurate identification can be performed, and the accuracy of roadside parking charge management by using the mobile inspection vehicle is improved.
In one embodiment, after S10 obtaining a plurality of roadside parking number images, each roadside parking number image including real character detection frame coordinate information and real character category information of a plurality of parking number characters, S20 training and optimizing a target detection model according to the plurality of roadside parking number images, and before obtaining the trained target detection model, the roadside parking number recognition method further includes:
s101, data enhancement is carried out on the road side berth number images.
In this embodiment, the data enhancement of the roadside berth number images includes data enhancement such as rotation transformation, brightness transformation, clipping transformation and the like of the roadside berth number images. The road side berth number images with different rotation angles are obtained by performing rotation transformation on the road side berth number images, the number of images of the image data set can be increased, and inclined road side berth number image data in a real shooting scene can be simulated.
The road side berth number images with different rotation angles are subjected to brightness conversion to obtain a plurality of road side berth number images with different brightness, the number of images of the image data set can be increased, and road side berth number image data under different brightness conditions in the morning, the evening and the evening under a real road side berth scene can be simulated.
The roadside berth number images with different brightness are cut randomly to obtain a plurality of roadside berth number images with different shielding degrees, the number of images of the image data set can be increased, and roadside berth number image data under the condition that vehicles shield berth numbers and the like under a real roadside berth scene can be simulated.
In one embodiment, the step S20 of training and optimizing the target detection model according to the multiple roadside berthage number images to obtain a trained target detection model includes:
s210, inputting a plurality of roadside berth number images into a target detection model, and outputting the coordinate information of a predicted character detection frame and the category information of predicted characters of each berth number character;
s220, constructing a loss function according to the real character detection frame coordinate information, the real character category information, the predicted character detection frame coordinate information and the predicted character category information, and training and optimizing the target detection model according to the loss function to obtain a trained target detection model.
In this embodiment, each roadside berth number image includes real character position information and real character category information of a plurality of berth number characters. And performing model training on the target detection model according to the real character detection frame coordinate information, the real character category information, the predicted character detection frame coordinate information and the predicted character category information to obtain a stable target detection model.
In one embodiment, the object detection model includes a backbone network, a feature pyramid network, and an object detection network. The backbone network includes, but is not limited to, convolutional neural networks such as ResNet, VGG, etc. The target detection network includes, but is not limited to, two-stage or single-stage target detection methods such as fast-RCNN, YOLO, SSD, etc.
And fusing the characteristic pyramid network into a backbone network to perform characteristic extraction and fusion on the roadside berth number images to obtain a plurality of characteristic fusion number images. And inputting the plurality of feature fusion number images into a target detection network for target detection, and outputting the coordinate information of the predicted character detection frame and the category information of the predicted character of each berth number character. A feature pyramid network structure is added in the backbone network structure, so that high-level semantic features can be extracted from different scales, and the extracted features are subjected to feature fusion. Feature Pyramid Networks (FPN) can solve the multi-scale problem.
The plurality of feature fusion number images include the fused features. The fused features are obtained by a feature pyramid network and fused with feature graphs with different resolutions. By adding the network connection of the characteristic pyramid network, the detection performance can be improved under the condition of not increasing the model calculation amount of the convolutional neural network. The feature pyramid network can fuse the features with lower resolution and stronger semantic features and the features with higher resolution and weaker semantic features in a plurality of roadside berth number images through the upper-lower path and the transverse connection, realize the fusion of different features and further improve the accuracy of detection.
The feature pyramid network is integrated into the backbone network, so that the extraction and integration of features can be realized, the problem that the sizes of shot numbers are different due to different positions away from the berth and different shooting angles when the mobile inspection equipment collects data is solved, and the identification accuracy of the roadside berth number identification method is improved.
In one embodiment, each feature fusion number image is input into a classification branch and a regression branch of the target detection network, and the coordinate information of the predicted character detection frame and the category information of the predicted character of each berth number character are output. And constructing a position regression loss function according to the coordinate information of the predicted character detection frame and the coordinate information of the real character detection frame of each berth number character. And constructing a class classification loss function according to the predicted character class information and the real character class information of each berth number character.
In the embodiment, each berth number character can be identified through the target detection network, so that the method has higher pertinence and can improve the identification accuracy. The classification branch of the target detection network is used for outputting predicted character category information of each berth number character. And the regression branch of the target detection network is used for outputting the coordinate information of the predicted character detection frame of each berth number character. And constructing a loss function of the target detection model according to the position regression loss function and the class classification loss function, and training and optimizing parameters of the target detection model. The loss function of the target detection model is L det =λ 1 L reg2 L cls
Wherein L is reg Representing the position regression loss function, L cls Representing a class classification loss function, λ 1 And λ 2 The weight coefficient representing the model loss function can be set to 1 or the weight coefficient proportion can be set according to the actual application condition.
In one embodiment, the position regression Loss function includes, but is not limited to, position regression Loss functions using a mean absolute error Loss function L1Loss, a mean square error Loss function L2Loss, a cross-over ratio Loss function IoU Loss, and the like. Class classification Loss functions include, but are not limited to, classification Loss functions using Cross Entropy Loss functions, Focal Loss functions, and the like. And training and optimizing parameters of the target detection model through the position regression loss function and the class classification loss function.
In one embodiment, the roadside berth number identification method further comprises removing part of the remaining detection frames through a Non-Maximum Suppression (NMS) algorithm, so that the identification detection precision can be further improved, and the final category and position of each berth number region can be obtained.
In one embodiment, S40, after obtaining the center point coordinates of each character detection box according to the character detection box coordinate information of each parking number character and performing line fitting according to each center point coordinate to obtain the fitted line equation of each parking number character, S50, obtaining the grouping distance of each center point coordinate and each fitted line equation according to each center point coordinate and each fitted line equation, and grouping each center point coordinate according to each grouping distance, before obtaining a plurality of parking number groups, the roadside parking number identification method further includes:
s401, calculating a slope difference value according to the slopes of any two fitting linear equations, and judging whether the slope difference value is smaller than a first threshold value;
s402, if the slope difference is smaller than a first threshold, calculating an intercept difference according to the intercept of the two fitted linear equations, and judging whether the intercept difference is smaller than a second threshold;
s403, if the intercept difference value is smaller than a second threshold value, calculating the slope average value and the intercept average value of the two fitted linear equations;
s404, obtaining a new fitting linear equation according to the slope average value and the intercept average value, and replacing the two fitting linear equations with the new fitting linear equation to obtain a new fitting linear equation corresponding to the berth number character.
In this embodiment, the numerical range of the first threshold and the second threshold may be limited according to actual situations. And randomly selecting the slopes of two fitting linear equations from the fitting linear equations to calculate the difference value, so as to obtain the slope difference value. Each slope represents a characteristic of each fitted line equation. By comparing the slopes of the two fitted linear equations, it can be determined whether the two fitted linear equations are independent, and it can also be understood as determining whether the two fitted linear equations are the same fitted linear equation. By calculating the intercept of the two fitted linear equations, the condition that the two fitted linear equations are parallel can be eliminated, and whether the two fitted linear equations are independent or not can be further judged. And when the slope difference value is smaller than the first threshold value and the intercept difference value is smaller than the second threshold value, judging that the two fitted linear equations are a straight line. And then, calculating the mean values of the slope and the intercept of the two fitted linear equations respectively to serve as the slope and the intercept of the new fitted linear equation, replacing the two fitted linear equations with the new fitted linear equation, and screening the fitted linear equations. The new fitted straight line equation is applied to the grouping distance calculation in the step S50.
Through calculation and judgment of the slope difference value and the intercept difference value in the embodiment, a plurality of fitting linear equations can be screened, two fitting linear equations with similar distances are screened out, and a new fitting linear equation is obtained for replacement, so that the fitting linear equation corresponding to each berth number character is obtained. Through S401 to S404 in this embodiment, redundant fitting linear equations are screened, the accuracy of roadside parking number identification is improved, and roadside parking charge management is facilitated.
In one embodiment, the roadside berth number identification method further comprises the following steps:
s405, if the slope difference value is larger than a first threshold value, the two fitted linear equations are two independent lines;
s406, if the intercept difference value is larger than a second threshold value, the two fitted linear equations are two independent straight lines;
wherein the first threshold value ranges from 3 to 7 and the second threshold value ranges from 17 to 24.
In this embodiment, the two independent straight lines may be understood as two independent straight lines, which are not the same fitting linear equation. If the slope difference is smaller than the first threshold and the intercept difference is larger than the second threshold, the two fitted linear equations are considered to be two independent straight lines and are not the same fitted linear equation. By setting the range of the first threshold value and the range of the second threshold value, the method can be better suitable for the size of each number character and the distance between adjacent number characters in the spray type berth number, so that the roadside berth number identification method has higher practicability, and the identification accuracy is improved.
In one embodiment, in S50, grouping each center point coordinate according to each grouping distance to obtain a plurality of groups of parking numbers includes:
s510, judging whether each grouping distance is smaller than a third threshold value;
s520, if the grouping distance is smaller than a third threshold value, dividing the center point coordinates corresponding to the grouping distance into the same group;
s530, forming each berth number group according to the berth number characters corresponding to each central point coordinate in the same group;
wherein the third threshold is in the range of 75 to 85.
In this embodiment, the grouping distance may be understood as a distance from the central point to the fitted linear equation, and a distance from all the coordinates of the central point to each fitted linear equation may be calculated and obtained. The third threshold value may be defined according to practical circumstances. Every grouping distance corresponds to a central point coordinate, and through screening the grouping distances, grouping of different parking number groups can be realized, and further screening is carried out on the characters of the parking numbers. In addition, the third threshold is set to be in a range of 75 to 85 in this embodiment, so that the grouping distances can be better divided, and further, all the center point coordinates can be better grouped. Through setting the first threshold, the second threshold and the third threshold, the identification process can be screened for three times, and the identification accuracy is improved.
In one embodiment, the step S60 of obtaining a roadside parking number sequence by sorting the character type information and the center point coordinates of each parking number character in each parking number group includes:
s610, according to the character type information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate, ascending order arrangement is carried out, and a roadside parking number code sequence is obtained.
In this embodiment, the character type information according to each parking number character includes 11 types including arabic numerals 0 to 9 and a character "-". The specific type of each parking number character in each parking number group can be obtained according to the character type information. The coordinates of the central point are expressed as (x, y), and the coordinates can be arranged in ascending order according to the size of the x-axis coordinate to form a corresponding roadside berth number code sequence.
Referring to fig. 2, in one embodiment, the present application provides a roadside berth number identification device 100. The roadside parking number recognition device 100 includes a data acquisition module 10, a model generation module 20, a character information acquisition module 30, a fitted linear equation acquisition module 40, a grouping module 50, and a roadside parking number sequence generation module 60. The data obtaining module 10 is configured to obtain a plurality of roadside berth number images, where each roadside berth number image includes real character detection frame coordinate information and real character category information of a plurality of berth number characters. The model generation module 20 is configured to train and optimize the target detection model according to the multiple roadside berth number images, and obtain a trained target detection model. The character information obtaining module 30 is configured to detect the roadside berth number image to be detected according to the trained target detection model, and obtain character detection frame coordinate information and character category information of a plurality of berth number characters.
The fitting linear equation obtaining module 40 is configured to obtain a central point coordinate of each character detection frame according to the character detection frame coordinate information of each parking number character, and perform linear fitting according to each central point coordinate to obtain a fitting linear equation of each parking number character. The grouping module 50 is configured to obtain a grouping distance from each center point coordinate to each fitted linear equation according to each center point coordinate and each fitted linear equation, and group each center point coordinate according to each grouping distance to obtain a plurality of berth number groups. The roadside parking number code sequence generating module 60 is configured to sort according to the character category information and the center point coordinates of each parking number character in each parking number group, and obtain a roadside parking number code sequence.
In this embodiment, the relevant description of the data obtaining module 10 may refer to the relevant description of S10 in the above embodiment. The relevant description of the model generation module 20 can refer to the relevant description of S20 in the above embodiment. The related description of the character information obtaining module 30 may refer to the related description of S30 in the above embodiment. The description of the fitting straight-line equation obtaining module 40 may refer to the description of S40 in the above embodiment. The related description of the grouping module 50 may refer to the related description of S50 in the above embodiment. The description of the roadside berth number sequence generating module 60 may refer to the description of S60 in the above embodiment.
In one embodiment, the roadside berth number identification device 100 further includes a first judging module (not shown), a second judging module (not shown), an average value obtaining module (not shown), and a new fitting linear equation obtaining module (not shown). The first judging module is used for calculating a slope difference value according to the slopes of any two fitting linear equations and judging whether the slope difference value is smaller than a first threshold value. And the second judgment module is used for calculating an intercept difference value according to the intercept of the two fitted linear equations if the slope difference value is smaller than the first threshold, and judging whether the intercept difference value is smaller than a second threshold. The average value obtaining module is used for calculating the slope average value and the intercept average value of the two fitting linear equations if the intercept difference value is smaller than a second threshold value. And the new fitting linear equation acquisition module is used for acquiring a new fitting linear equation according to the slope average value and the intercept average value, replacing the two fitting linear equations with the new fitting linear equation and acquiring a new fitting linear equation corresponding to the berth number character.
In this embodiment, the relevant description of the first determining module may refer to the relevant description of S401 in the above embodiment. The relevant description of the second judging module may refer to the relevant description of S402 in the above embodiment. The description of the average value obtaining module may refer to the description of S403 in the above embodiment. The relevant description of the new fitted straight-line equation obtaining module may refer to the relevant description of S404 in the above embodiment.
In one embodiment, the roadside berth number identification device 100 further includes a third determination module (not shown) and a fourth determination module (not shown). The third judging module is used for judging that the two fitted linear equations are two independent lines if the slope difference value is larger than the first threshold value. And the fourth judging module (not labeled in the figure) is used for judging that the two fitted linear equations are two independent straight lines if the intercept difference value is larger than the second threshold value. Wherein the first threshold value ranges from 3 to 7 and the second threshold value ranges from 17 to 24.
In this embodiment, reference may be made to the description of S405 in the foregoing embodiment for the description of the third determining module. The relevant description of the fourth judging module can refer to the relevant description of S406 in the above embodiment.
In one embodiment, the grouping module 50 includes a fifth determining module (not shown), a center point coordinate dividing module (not shown), and a parking number group forming module (not shown). The fifth judging module is used for judging whether each grouping distance is smaller than a third threshold value. And the central point coordinate dividing module is used for dividing the central point coordinates corresponding to the grouping distances into the same group if the grouping distances are smaller than a third threshold value. The parking number group forming module is used for forming each parking number group according to the parking number characters corresponding to the coordinates of each central point in the same group. Wherein the third threshold is in the range of 75 to 85.
In this embodiment, reference may be made to the description of S510 in the foregoing embodiment for the description of the fifth determining module. The description of the center point coordinate dividing module may refer to the description of S520 in the above embodiment. The relevant description of the parking number group forming module can refer to the relevant description of S530 in the above embodiment.
In one embodiment, the roadside berth number sequence generating module 60 includes a sorting module (not labeled in the figure). The sorting module is used for performing ascending order arrangement according to the character category information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate to obtain a roadside parking number code sequence.
In this embodiment, the relevant description of the sorting module may refer to the relevant description of S610 in the above embodiment.
In one embodiment, the model generation module 20 includes a target detection model construction module (not shown) and a training optimization module (not shown). The target detection model construction module is used for inputting a plurality of roadside berth number images into the target detection model and outputting the coordinate information of the predicted character detection frame and the category information of the predicted characters of each berth number character. And the training optimization module is used for constructing a loss function according to the coordinate information of the real character detection frame, the category information of the real character, the position information of the predicted character and the category information of the predicted character, and training and optimizing the target detection model according to the loss function to obtain the trained target detection model.
In this embodiment, the relevant description of the target detection model building module may refer to the relevant description of S210 in the above embodiment. The related description of the training optimization module can refer to the related description of S220 in the above embodiment.
In the various embodiments described above, the particular order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not intended to be limited to the specific order or hierarchy presented.
Those of skill in the art will also appreciate that the various illustrative logical blocks, modules, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, modules, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The various illustrative logical blocks, or modules, described in the embodiments herein may be implemented or operated by a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in the embodiments herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are described in further detail, it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (12)

1. A roadside berth number identification method is characterized by comprising the following steps:
acquiring a plurality of roadside berth number images, wherein each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters;
training and optimizing a target detection model according to the multiple roadside berth number images to obtain a trained target detection model;
detecting the roadside berth number image to be detected according to the trained target detection model to obtain character detection frame coordinate information and character category information of a plurality of berth number characters;
obtaining the coordinate of the central point of each character detection frame according to the coordinate information of the character detection frame of each parking number character, and performing linear fitting according to the coordinate of each central point to obtain a fitted linear equation of each parking number character;
according to each central point coordinate and each fitting linear equation, obtaining a grouping distance from each central point coordinate to each fitting linear equation, and grouping each central point coordinate according to each grouping distance to obtain a plurality of berth number groups;
and sequencing according to the character category information and the central point coordinates of each parking number character in each parking number group to obtain a roadside parking number sequence.
2. The roadside berth number identification method according to claim 1, wherein before obtaining a plurality of berth number groups, after obtaining center point coordinates of each character detection frame according to character detection frame coordinate information of each berth number character, and performing line fitting according to each center point coordinate to obtain a fitted line equation of each berth number character, obtaining a grouping distance of each center point coordinate and each fitted line equation according to each center point coordinate and each fitted line equation, and grouping each center point coordinate according to each grouping distance, the method further comprises:
calculating a slope difference value according to the slopes of any two fitting linear equations, and judging whether the slope difference value is smaller than a first threshold value;
if the slope difference value is smaller than the first threshold value, calculating an intercept difference value according to the intercept of the two fitted linear equations, and judging whether the intercept difference value is smaller than a second threshold value;
if the intercept difference is smaller than the second threshold, calculating the slope average value and the intercept average value of the two fitted linear equations;
and obtaining a new fitted linear equation according to the slope average value and the intercept average value, and replacing the two fitted linear equations with the new fitted linear equation to obtain the new fitted linear equation corresponding to the berth number character.
3. The roadside berth number identification method according to claim 2, further comprising:
if the slope difference value is larger than the first threshold value, the two fitted linear equations are two independent straight lines;
if the intercept difference is greater than the second threshold, the two fitted linear equations are two independent straight lines;
wherein the first threshold is in the range of 3 to 7 and the second threshold is in the range of 17 to 24.
4. The roadside berth number identification method according to claim 1, wherein the grouping each of the center point coordinates according to each of the grouping distances to obtain a plurality of berth number groups comprises:
judging whether each grouping distance is smaller than a third threshold value;
if the grouping distance is smaller than the third threshold, dividing the center point coordinates corresponding to the grouping distance into the same group;
forming each berth number group according to the berth number character corresponding to each central point coordinate in the same group;
wherein the third threshold is in a range of 75 to 85.
5. The roadside parking number identification method of claim 4, wherein the obtaining a roadside parking number sequence by sorting according to the character category information and the center point coordinates of each of the parking number characters in each of the parking number groups comprises:
and performing ascending arrangement according to the character category information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate to obtain the roadside parking number code sequence.
6. The berth number identification method according to claim 1, wherein the training and optimizing the target detection model according to the multiple roadside berth number images to obtain the trained target detection model comprises:
inputting the roadside berth number images into a target detection model, and outputting the coordinate information of a predicted character detection frame and the category information of predicted characters of each berth number character;
and constructing a loss function according to the real character detection frame coordinate information, the real character category information, the predicted character position information and the predicted character category information, and performing training optimization on the target detection model according to the loss function to obtain a trained target detection model.
7. A roadside berth number identification device, characterized by comprising:
the system comprises a data acquisition module, a data processing module and a data processing module, wherein the data acquisition module is used for acquiring a plurality of roadside berth number images, and each roadside berth number image comprises real character detection frame coordinate information and real character category information of a plurality of berth number characters;
the model generation module is used for training and optimizing a target detection model according to the multiple roadside berth number images to obtain a trained target detection model;
the character information acquisition module is used for detecting the roadside berth number image to be detected according to the trained target detection model to acquire character detection frame coordinate information and character category information of a plurality of berth number characters;
the fitting linear equation acquisition module is used for acquiring the central point coordinate of each character detection frame according to the character detection frame coordinate information of each parking number character, and performing linear fitting according to each central point coordinate to acquire a fitting linear equation of each parking number character;
the grouping module is used for acquiring the grouping distance from each central point coordinate to each fitting linear equation according to each central point coordinate and each fitting linear equation, and grouping each central point coordinate according to each grouping distance to obtain a plurality of berth number groups;
and the roadside parking number code sequence generating module is used for sequencing according to the character category information and the central point coordinates of each parking number character in each parking number group to obtain a roadside parking number code sequence.
8. The roadside berth number identification device of claim 7, further comprising:
the first judgment module is used for calculating a slope difference value according to the slopes of any two fitting linear equations and judging whether the slope difference value is smaller than a first threshold value or not;
the second judgment module is used for calculating an intercept difference value according to the intercept of the two fitted linear equations and judging whether the intercept difference value is smaller than a second threshold value if the slope difference value is smaller than the first threshold value;
the average value obtaining module is used for calculating the slope average value and the intercept average value of the two fitted linear equations if the intercept difference value is smaller than the second threshold value;
and the new fitting linear equation obtaining module is used for obtaining a new fitting linear equation according to the slope average value and the intercept average value, replacing the two fitting linear equations with the new fitting linear equation, and obtaining the new fitting linear equation corresponding to the berth number character.
9. The roadside berth number identification device of claim 8, further comprising:
the third judging module is used for judging that the two fitted linear equations are two independent lines if the slope difference value is larger than the first threshold value;
the fourth judgment module is used for judging that the two fitted linear equations are two independent straight lines if the intercept difference value is larger than the second threshold value;
wherein the first threshold value ranges from 3 to 7 and the second threshold value ranges from 17 to 24.
10. The roadside berth number identification device of claim 7, wherein the grouping module comprises:
a fifth judging module, configured to judge whether each of the grouping distances is smaller than a third threshold;
a central point coordinate dividing module, configured to divide the central point coordinates corresponding to the grouping distances into a same group if the grouping distance is smaller than the third threshold;
the berth number group forming module is used for forming each berth number group according to the berth number character corresponding to each central point coordinate in the same group;
wherein the third threshold is in a range of 75 to 85.
11. The roadside parking number identification device of claim 10, wherein the roadside parking number sequence generating module comprises:
and the sequencing module is used for performing ascending sequence arrangement according to the character type information of each parking number character in each parking number group and the x-axis coordinate of the central point coordinate to obtain the roadside parking number code sequence.
12. The berth number identification device according to claim 7, wherein the model generation module comprises:
the target detection model construction module is used for inputting the roadside berth number images into a target detection model and outputting the coordinate information of a predicted character detection frame and the category information of predicted characters of each berth number character;
and the training optimization module is used for constructing a loss function according to the real character detection frame coordinate information, the real character category information, the predicted character position information and the predicted character category information, and training and optimizing the target detection model according to the loss function to obtain a trained target detection model.
CN202210292187.1A 2022-03-23 2022-03-23 Roadside berth number identification method and device Pending CN114842285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210292187.1A CN114842285A (en) 2022-03-23 2022-03-23 Roadside berth number identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210292187.1A CN114842285A (en) 2022-03-23 2022-03-23 Roadside berth number identification method and device

Publications (1)

Publication Number Publication Date
CN114842285A true CN114842285A (en) 2022-08-02

Family

ID=82562604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210292187.1A Pending CN114842285A (en) 2022-03-23 2022-03-23 Roadside berth number identification method and device

Country Status (1)

Country Link
CN (1) CN114842285A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116016805A (en) * 2023-03-27 2023-04-25 四川弘和通讯集团有限公司 Data processing method, device, electronic equipment and storage medium
CN117523688A (en) * 2023-11-16 2024-02-06 杭州目博科技有限公司 Roadside berth parking management system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116016805A (en) * 2023-03-27 2023-04-25 四川弘和通讯集团有限公司 Data processing method, device, electronic equipment and storage medium
CN117523688A (en) * 2023-11-16 2024-02-06 杭州目博科技有限公司 Roadside berth parking management system

Similar Documents

Publication Publication Date Title
CN109087510B (en) Traffic monitoring method and device
CN108986465B (en) Method, system and terminal equipment for detecting traffic flow
CN110751099B (en) Unmanned aerial vehicle aerial video track high-precision extraction method based on deep learning
CN112069944B (en) Road congestion level determining method
CN114842285A (en) Roadside berth number identification method and device
CN111554105B (en) Intelligent traffic identification and statistics method for complex traffic intersection
CN110827326B (en) Method, device, equipment and storage medium for generating simulation man-vehicle conflict scene model
CN112837542B (en) Method and device for counting traffic volume of highway section, storage medium and terminal
CN103679214A (en) Vehicle detection method based on online area estimation and multi-feature decision fusion
CN114898243A (en) Traffic scene analysis method and device based on video stream
CN111724607B (en) Steering lamp use detection method and device, computer equipment and storage medium
CN117037085A (en) Vehicle identification and quantity statistics monitoring method based on improved YOLOv5
CN112784494A (en) Training method of false positive recognition model, target recognition method and device
CN117058912A (en) Method and device for detecting abnormal parking of inspection vehicle, storage medium and electronic equipment
CN116682101A (en) License plate number recognition method and system
CN114882490B (en) Unlimited scene license plate detection and classification method based on point-guided positioning
CN116091964A (en) High-order video scene analysis method and system
CN114519791A (en) License plate character recognition method and device
CN114926724A (en) Data processing method, device, equipment and storage medium
CN114782938A (en) License plate character recognition method and device
CN114241482A (en) License plate recognition and detection method and device
CN113435350A (en) Traffic marking detection method, device, equipment and medium
CN114999183B (en) Traffic intersection vehicle flow detection method
CN114926984B (en) Real-time traffic conflict collection and road safety evaluation method
CN114724129A (en) License plate recognition method and device

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