License plate recognition method, system and equipment
By converting the image to grayscale and calculating the characters and colors of the license plate in parallel, the problem of low recognition rate and slow speed of traditional license plate recognition algorithms in complex environments is solved, achieving faster and more accurate license plate recognition.
Patent Information
- Application Number
- CN202511164111.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional license plate recognition algorithms suffer from low recognition rates and slow processing speeds in complex environments. Furthermore, character recognition and color recognition are performed independently without any correlation, which affects recognition accuracy.
The image is converted to a grayscale image. The license plate coordinates are obtained from the grayscale image and the license plate image is cropped. Parallel computation and character and color correction are performed. The color is corrected using the characters, and a mapping relationship between characters and colors is established.
It reduces the computational and time consumption of model inference, improves the speed and accuracy of license plate recognition, and optimizes the latency of the overall recognition process.
Smart Images

Figure CN120976909A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target recognition, and more specifically to a license plate recognition method, system, and device. Background Technology
[0002] With the rapid development and popularization of intelligent transportation systems, license plate recognition technology plays a key role in traffic management and vehicle monitoring.
[0003] However, traditional license plate recognition algorithms suffer from low recognition rates and slow processing speeds in complex environments (such as changing lighting, damaged license plates, and shooting angle deviations). For example, traditional vehicle image data detection methods involve a large amount of image data, and the processing speed for this image data is slow. This makes them unsuitable for recognition scenarios with limited computing resources and high latency requirements, resulting in slow recognition speeds of license plate features in image data, failing to meet the needs of practical applications. For instance, when dealing with high frame rate camera video streams such as 60 frames per second, even higher demands are placed on backend processing speed. High frame rates mean that more image data needs to be processed per unit of time; if the backend processing speed cannot keep up, data backlog will occur, making it impossible to accurately recognize license plates in real time.
[0004] Furthermore, in traditional license plate recognition, character recognition and color recognition are performed separately. This approach does not consider the potential inherent relationship between characters and colors. For example, in some cases, a license plate of a specific color may correspond to a specific type of character combination or format. Due to the lack of consideration for this correlation, the recognized license plate characters and colors may not match the actual license plate, thus affecting the accuracy and reliability of license plate recognition. Therefore, how to improve the accuracy of license plate character and color recognition while rapidly performing license plate reasoning is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, in order to overcome at least one aspect of the above problems, embodiments of the present invention propose a license plate recognition method, comprising the following steps: Acquire the image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; The first vertex coordinates of the license plate are obtained based on the grayscale image, and the license plate image is cropped from the image to be recognized according to the first vertex coordinates. The license plate image is input into a color recognition model and a character recognition model respectively for parallel computation to obtain the color and characters of the license plate; The characters and colors of the license plate are corrected and output.
[0006] In some embodiments, correcting and outputting the characters and colors of the license plate further includes: The characters on the license plate are individually corrected; The color of the license plate is corrected using the corrected characters, and the correction result is output.
[0007] In some embodiments, correcting the color of the license plate based on the identified characters further includes: Obtain the mapping relationship between the characters and colors of the license plate; Based on the characters of the license plate obtained from the recognition, a corresponding mapping relationship is determined, and the color of the license plate in the corresponding mapping relationship is determined; In response to the identification that the color of the license plate is inconsistent with the color of the license plate in the corresponding mapping relationship, the color of the license plate in the corresponding mapping relationship is used for correction.
[0008] In some embodiments, acquiring an image to be identified and performing grayscale processing on the image to be identified to obtain a grayscale image further includes: The host receives the video stream captured by the camera and obtains the image to be identified based on the video stream; The image to be identified is sent to the device side for grayscale processing.
[0009] In some embodiments, receiving a video stream captured by a camera on the host side and obtaining the image to be identified based on the video stream further includes: In response to acquiring video stream data, the video stream data is converted frame by frame to obtain multiple images; Every preset number of images, one image is selected to be identified; The selected images to be identified are preprocessed.
[0010] In some embodiments, obtaining the first vertex coordinates of the license plate based on the grayscale image further includes: The first model is used to detect the grayscale image to obtain the coordinates of the first vertex of the license plate and the license plate type; The license plate type is input into the character recognition model so that the character recognition model can perform calculations on the license plate image based on the license plate type.
[0011] In some embodiments, inputting the license plate image into a character recognition model to calculate the characters of the license plate further includes: In response to the character recognition model receiving a license plate type of single-layer license plate, character recognition is performed directly on the license plate; In response to the character recognition model receiving a license plate type of double-layer license plate, the license plate image is divided into a first layer image and a second layer image according to a preset ratio along the vertical axis, and the first layer image and the second layer image are horizontally stitched together to obtain an image for character recognition.
[0012] In some embodiments, cropping the license plate image from the image to be recognized based on the first vertex coordinates further includes: The lengths of the four sides of the license plate image are obtained based on the coordinates of the first vertex, and the coordinates of the second vertex are obtained based on the coordinates of the four sides. The transformation matrix is obtained based on the coordinates of the first vertex and the coordinates of the second vertex; The license plate image is corrected by performing a perspective transformation on the license plate image based on the transformation matrix.
[0013] In some embodiments, obtaining the four side lengths of the license plate image based on the first vertex coordinates, and obtaining the second vertex coordinates based on the four side lengths, further includes: A first maximum value is determined from the first side length and the second side length of the license plate image, and a second maximum value is determined from the second side length and the third side length of the license plate image; The corrected coordinates of the second vertex are obtained using the first maximum value and the second maximum value.
[0014] Based on the same inventive concept, according to another aspect of the present invention, embodiments of the present invention also provide a license plate recognition system, comprising: The acquisition module is configured to acquire the image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; The cropping module is configured to obtain the first vertex coordinates of the license plate based on the grayscale image, and crop the license plate image from the image to be recognized according to the first vertex coordinates. The calculation module is configured to input the license plate image into a color recognition model and a character recognition model respectively for parallel calculation to obtain the color and characters of the license plate; The correction module is configured to correct and output the characters and colors of the license plate.
[0015] Based on the same inventive concept, according to another aspect of the present invention, embodiments of the present invention also provide a computer device, comprising: At least one processor; and The memory stores a computer program that can run on the processor, which, when executing the program, performs the steps of any of the license plate recognition methods described above.
[0016] Based on the same inventive concept, according to another aspect of the present invention, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of any of the license plate recognition methods described above.
[0017] This invention offers one of the following beneficial technical effects: The proposed solution converts the original image to a grayscale image, then obtains the license plate coordinates based on this grayscale image. This reduces the computational and time consumption of the model inference, allowing for faster acquisition of the license plate coordinates. Then, based on the license plate coordinates, the license plate image is cropped from the original image, and parallel computation and mutual correction based on the license plate's characters and colors are performed. This optimizes the latency of both the color recognition model and the character recognition model throughout the entire process, further reducing the overall inference time and improving recognition accuracy. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic flowchart of a license plate recognition method provided in an embodiment of the present invention; Figure 2 This describes the video stream acquisition process in existing technologies. Figure 3 The video stream acquisition process provided for embodiments of the present invention; Figure 4 A schematic diagram of the structure of a license plate recognition system provided in an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a computer device provided for an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided for an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.
[0021] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two entities or parameters with the same name but different names. It is clear that "first" and "second" are only for the convenience of expression and should not be construed as limiting the embodiments of the present invention. Subsequent embodiments will not explain this in detail.
[0022] According to one aspect of the present invention, embodiments of the present invention provide a license plate recognition method, such as... Figure 1 As shown, it may include the following steps: S1, acquire the image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; S2, obtain the first vertex coordinates of the license plate based on the grayscale image, and crop out the license plate image from the image to be recognized according to the first vertex coordinates; S3, the license plate image is input into the color recognition model and the character recognition model respectively for parallel calculation to obtain the color and characters of the license plate; S4, correct and output the characters and colors of the license plate.
[0023] The proposed solution converts the original image to a grayscale image and then obtains the license plate coordinates based on the grayscale image. This reduces the computational and time consumption of the model inference, allowing for faster acquisition of the license plate coordinates. Then, based on the license plate coordinates, the license plate image is cropped from the original image, and parallel computation and mutual correction based on the license plate's characters and colors are performed. This optimizes the latency of both the color recognition model and the character recognition model, further reducing the overall inference time and improving recognition accuracy.
[0024] In some embodiments, since the character recognition model consumes more computing resources and inference time than the color model, the color recognition model can be deployed on the CPU and the character recognition model on the GPU, thereby allocating more GPU resources to the character recognition model and further reducing the inference time of the character recognition model.
[0025] In some embodiments, correcting and outputting the characters and colors of the license plate further includes: The characters on the license plate are individually corrected; The color of the license plate is corrected using the corrected characters, and the correction result is output.
[0026] Specifically, after obtaining the character detection result, the characters can be corrected individually, and the color can be corrected using the characters. When correcting the characters individually, the Chinese characters except the first and last characters need to be removed, and it is necessary to determine whether the last Chinese character is one of the preset characters, for example, whether it is one of "ling gang ao xue gua jing lin", if not, the recognition is incorrect. Then, the color of the license plate is corrected using the characters of the corrected license plate, so as to associate the character recognition result of the license plate with the color recognition result, and combine the recognized character information with the corresponding color information, so that the color is corrected based on the character recognition result of the license plate, improving the accuracy of color recognition.
[0027] In some embodiments, correcting the color of the license plate according to the recognized characters of the license plate further includes: Obtain the mapping relationship between the characters and colors of the license plate; Determine the corresponding mapping relationship according to the recognized characters of the license plate, and determine the color of the license plate in the corresponding mapping relationship; In response to the recognized color of the license plate being inconsistent with the color of the license plate in the corresponding mapping relationship, correct the color using the color of the license plate in the corresponding mapping relationship.
[0028] Specifically, when correcting the color using the characters, a mapping relationship between the characters and colors can be established in advance. For example, if the last character of the license plate character is "jing", the corresponding mapped license plate color is white. If the Chinese characters "shi" and "ling" are not included in the license plate, the corresponding mapped license plate color is blue or green. When the characters are recognized, the recognized license plate color is corrected through the mapping relationship, making the recognition result more accurate.
[0029] In some embodiments, obtaining the image to be recognized and performing grayscale processing on the image to be recognized to obtain a grayscale image further includes: Receive the video stream collected by the camera on the host side, and obtain the image to be recognized based on the video stream; Send the image to be recognized to the device side for grayscale processing.
[0030] Specifically, the Host side (host side) generally refers to the server connected to the hardware device where the AI processor is located, and the Device side (device side) generally refers to the hardware device installed with the AI processor. As Figure 2 shown, in the existing process, after accessing the remote camera through the RTSP (RealTime Streaming Protocol) address, the initial data is stored on the Device side, and then copied to the Host side for preprocessing by means of memory copy. After processing, it is copied back to the Device side for inference by means of memory copy, that is, 2 memory copies are required. In this embodiment, as Figure 3 As shown, after accessing the remote camera via the RTSP (Real Time Streaming Protocol) address, the initial data is directly stored on the Host side, preprocessed, and then copied to the Device side via memory copy. This process only requires one memory copy, reducing the time and space resources consumed by the memory copy step, thereby speeding up the inference speed.
[0031] In some embodiments, receiving a video stream captured by a camera on the host side and obtaining the image to be identified based on the video stream further includes: In response to acquiring video stream data, the video stream data is converted frame by frame to obtain multiple images; Every preset number of images, one image is selected to be identified; The selected images to be identified are preprocessed.
[0032] Specifically, in road driving scenarios, the video frame rate is relatively fast compared to the driving speed. This means that in a short period of consecutively captured video frames, the vehicle's state, position, and other information typically do not change significantly between consecutive frames. Therefore, to save energy and computing power while minimizing the possibility of missed or insufficient captures, an image to be identified can be selected every preset number of images, for example, license plate inference can be performed every six frames. After selecting the image to be identified, the image data needs to be preprocessed, such as resizing and converting color channels, to meet the image format required by the model for inference. Furthermore, data decoding and preprocessing only need to be performed on the host side, eliminating the need to deploy corresponding interfaces on the device side for the inference model, thus improving the program's reusability.
[0033] For example, if the frame rate of reading a remote camera connected via an RTSP address is 1-5ms / frame and the frame rate of reading local video is 1-3ms / frame, by performing license plate inference every six frames, it can keep up with the frame rate of the video stream well and there is no delay caused by not being able to process the backlog of data.
[0034] In some embodiments, obtaining the first vertex coordinates of the license plate based on the grayscale image further includes: The first model is used to detect the grayscale image to obtain the coordinates of the first vertex of the license plate and the license plate type; The license plate type is input into the character recognition model so that the character recognition model can perform calculations on the license plate image based on the license plate type.
[0035] Specifically, existing technologies typically use RGB three-channel images as model input to obtain license plate coordinates. This application, however, pre-trains a first model based on grayscale images, such as the YOLO model. During actual inference, the grayscale image is directly used for model reasoning, eliminating the need for RGB three-channel images. Since a grayscale image has only one color channel, while an RGB image has three, the grayscale image size is only 1 / 3 that of an RGB image. Furthermore, the YOLO model does not include color features in its object detection features. Therefore, using a grayscale image instead of an RGB image as input significantly reduces the data stream size, thereby reducing the time spent copying image data and decreasing the computational and time consumption of model inference. In this embodiment, the YOLO model trained on grayscale images can simultaneously determine whether the license plate is single or double-layered (i.e., determine the license plate type) while detecting the license plate bounding box. This allows the subsequent character recognition model to perform character recognition without needing to determine the license plate type, thus accelerating the character recognition model's recognition speed.
[0036] In some embodiments, inputting the license plate image into a character recognition model to calculate the characters of the license plate further includes: In response to the character recognition model receiving a license plate type of single-layer license plate, character recognition is performed directly on the license plate; In response to the character recognition model receiving a license plate type of double-layer license plate, the license plate image is divided into a first layer image and a second layer image according to a preset ratio along the vertical axis, and the first layer image and the second layer image are horizontally stitched together to obtain an image for character recognition.
[0037] Specifically, if the license plate is identified as a single-layer plate, character recognition is performed directly. If the license plate is identified as a double-layer plate, it needs to be segmented and stitched together. During segmentation and stitching, the license plate can be divided along the Y-axis (vertical axis) at a preset ratio. For example, the license plate image can be divided into two parts (upper and lower) using a 5 / 12 dividing line, and then stretched into two smaller images of equal height. The first and second smaller images are then horizontally stitched together. This process transforms a double-layer license plate into a single-layer plate, allowing for character recognition.
[0038] In some embodiments, cropping the license plate image from the image to be recognized based on the first vertex coordinates further includes: The lengths of the four sides of the license plate image are obtained based on the coordinates of the first vertex, and the coordinates of the second vertex are obtained based on the coordinates of the four sides. The transformation matrix is obtained based on the coordinates of the first vertex and the coordinates of the second vertex; The license plate image is corrected by performing a perspective transformation on the license plate image based on the transformation matrix.
[0039] Specifically, because vehicles captured by roadside cameras may be turning or making U-turns, their license plates are not entirely on a single plane, resulting in tilted or recessed images. Therefore, after obtaining the cropped license plate image, it is corrected to correct the tilt and recess, resulting in a smaller, more planar license plate image. This improves the accuracy of character recognition in subsequent steps. During correction, the corrected vertex coordinates are first obtained based on the four sides of the license plate image. A transformation matrix is then derived based on the original and corrected vertex coordinates. This transformation matrix is used to transform other points in the license plate image to obtain the corrected license plate image.
[0040] In some embodiments, obtaining the four side lengths of the license plate image based on the first vertex coordinates, and obtaining the second vertex coordinates based on the four side lengths, further includes: A first maximum value is determined from the first side length and the second side length of the license plate image, and a second maximum value is determined from the second side length and the third side length of the license plate image; The corrected coordinates of the second vertex are obtained using the first maximum value and the second maximum value.
[0041] Specifically, if the four vertices of the license plate image are arranged in the order of top left, top right, bottom right, and bottom left, the lengths of the four sides of the quadrilateral formed by the four vertices can be calculated as w1, w2, h1, and h2, respectively. Here, w and h represent two pairs of opposite sides, with w approximating the horizontal direction and h approximating the vertical direction. Then, the larger values are taken from w1, w2 and h1, h2, for example, W and H respectively. This yields the corrected coordinates of the four vertices: (0, 0), (W-1, 0), (0, H-1), and (W-1, H-1). These four corrected vertex coordinates can be mapped one-to-one with the original four vertex coordinates, resulting in four pairs of mapped points. The transformation matrix is then obtained based on the following formula: = That is, X'= Y'=
[0042] Where (X', Y') are the corrected vertex coordinates and (X, Y) are the original vertex coordinates. Thus, each pair of mapping points yields 2 equations, and four pairs of mapping points yield 8 equations. Based on these 8 equations, a, b, c, d, e, f, g, and h can be obtained.
[0043] The proposed solution converts the original image to a grayscale image and then obtains the license plate coordinates based on the grayscale image. This reduces the computational and time consumption of the model inference, allowing for faster acquisition of the license plate coordinates. Then, based on the license plate coordinates, the license plate image is cropped from the original image, and parallel computation is performed on the license plate image. This optimizes the latency of the entire process for both the color recognition model and the character recognition model, further reducing the overall inference time.
[0044] Based on the same inventive concept, according to another aspect of the present invention, embodiments of the present invention also provide a license plate recognition system 400, such as... Figure 4 As shown, it includes: The acquisition module 401 is configured to acquire an image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; The cropping module 402 is configured to obtain the first vertex coordinates of the license plate based on the grayscale image, and crop out the license plate image from the image to be recognized according to the first vertex coordinates. The calculation module 403 is configured to input the license plate image into the color recognition model and the character recognition model respectively for parallel calculation to obtain the color and characters of the license plate; The correction module 404 is configured to correct and output the characters and colors of the license plate.
[0045] In some embodiments, correcting and outputting the characters and colors of the license plate further includes: The color of the license plate is corrected based on the characters identified, and the correction result is output.
[0046] In some embodiments, acquiring an image to be identified and performing grayscale processing on the image to be identified to obtain a grayscale image further includes: The host receives the video stream captured by the camera and obtains the image to be identified based on the video stream; The image to be identified is sent to the device side for grayscale processing.
[0047] In some embodiments, receiving a video stream captured by a camera on the host side and obtaining the image to be identified based on the video stream further includes: In response to acquiring video stream data, the video stream data is converted frame by frame to obtain multiple images; Every preset number of images, one image is selected to be identified; The selected images to be identified are preprocessed.
[0048] In some embodiments, obtaining the first vertex coordinates of the license plate based on the grayscale image further includes: The first model is used to detect the grayscale image to obtain the coordinates of the first vertex of the license plate and the license plate type; The license plate type is input into the character recognition model so that the character recognition model can perform calculations on the license plate image based on the license plate type.
[0049] In some embodiments, inputting the license plate image into a character recognition model to calculate the characters of the license plate further includes: In response to the character recognition model receiving a license plate type of single-layer license plate, character recognition is performed directly on the license plate; In response to the character recognition model receiving a license plate type of double-layer license plate, the license plate image is divided into a first layer image and a second layer image according to a preset ratio along the vertical axis, and the first layer image and the second layer image are horizontally stitched together to obtain an image for character recognition.
[0050] In some embodiments, cropping the license plate image from the image to be recognized based on the first vertex coordinates further includes: The lengths of the four sides of the license plate image are obtained based on the coordinates of the first vertex, and the coordinates of the second vertex are obtained based on the coordinates of the four sides. The transformation matrix is obtained based on the coordinates of the first vertex and the coordinates of the second vertex; The license plate image is corrected by performing a perspective transformation on the license plate image based on the transformation matrix.
[0051] In some embodiments, obtaining the four side lengths of the license plate image based on the first vertex coordinates, and obtaining the second vertex coordinates based on the four side lengths, further includes: A first maximum value is determined from the first side length and the second side length of the license plate image, and a second maximum value is determined from the second side length and the third side length of the license plate image; The corrected coordinates of the second vertex are obtained using the first maximum value and the second maximum value.
[0052] In some embodiments, correcting the color of the license plate based on the identified characters further includes: Obtain the mapping relationship between the characters and colors of the license plate; Based on the characters of the license plate obtained from the recognition, a corresponding mapping relationship is determined, and the color of the license plate in the corresponding mapping relationship is determined; In response to the identification that the color of the license plate is inconsistent with the color of the license plate in the corresponding mapping relationship, the color of the license plate in the corresponding mapping relationship is used for correction.
[0053] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 5 As shown, embodiments of the present invention also provide a computer device 501, comprising: At least one processor 520; and The memory 510 stores a computer program 511 that can run on a processor. When the processor 520 executes the program, it performs the steps of any of the license plate recognition methods described above.
[0054] Based on the same inventive concept, according to another aspect of the present invention, such as Figure 6 As shown, embodiments of the present invention also provide a computer-readable storage medium 601, which stores a computer program 610. When the computer program 610 is executed by a processor, it performs the steps of any of the license plate recognition methods described above.
[0055] Finally, it should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods.
[0056] Furthermore, it should be understood that the computer-readable storage medium (e.g., memory) described herein may be volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory.
[0057] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.
[0058] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.
[0059] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.
[0060] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0061] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0062] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A license plate recognition method, characterized in that, Includes the following steps: Acquire the image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; The first vertex coordinates of the license plate are obtained based on the grayscale image, and the license plate image is cropped from the image to be recognized according to the first vertex coordinates. The license plate image is input into a color recognition model and a character recognition model respectively for parallel computation to obtain the color and characters of the license plate; The characters and colors of the license plate are corrected and output.
2. The method as described in claim 1, characterized in that, The process of correcting and outputting the characters and colors of the license plate further includes: The characters on the license plate are individually corrected; The color of the license plate is corrected using the corrected characters, and the correction result is output.
3. The method as described in claim 2, characterized in that, Correcting the color of the license plate based on the identified characters further includes: Obtain the mapping relationship between the characters and colors of the license plate; Based on the characters of the license plate obtained from the recognition, a corresponding mapping relationship is determined, and the color of the license plate in the corresponding mapping relationship is determined; In response to the identification that the color of the license plate is inconsistent with the color of the license plate in the corresponding mapping relationship, the color of the license plate in the corresponding mapping relationship is used for correction.
4. The method as described in claim 1, characterized in that, The method further includes acquiring an image to be identified and performing grayscale processing on the image to be identified to obtain a grayscale image, and further comprising: The host receives the video stream captured by the camera and obtains the image to be identified based on the video stream; The image to be identified is sent to the device side for grayscale processing.
5. The method as described in claim 4, characterized in that, Receiving a video stream captured by a camera on the host side, and obtaining the image to be identified based on the video stream, further includes: In response to acquiring video stream data, the video stream data is converted frame by frame to obtain multiple images; Every preset number of images, one image is selected to be identified; The selected images to be identified are preprocessed.
6. The method as described in claim 1, characterized in that, The method further includes obtaining the first vertex coordinates of the license plate based on the grayscale image, and using a first model to detect the grayscale image to obtain the first vertex coordinates of the license plate and the license plate type. The license plate image is input into a character recognition model to calculate the characters of the license plate, further including: In response to the character recognition model receiving a license plate type of single-layer license plate, character recognition is performed directly on the license plate; In response to the character recognition model receiving a license plate type of double-layer license plate, the license plate image is divided into a first layer image and a second layer image according to a preset ratio along the vertical axis, and the first layer image and the second layer image are horizontally stitched together to obtain an image for character recognition.
7. The method as described in claim 1, characterized in that, Cropping the license plate image from the image to be recognized based on the coordinates of the first vertex further includes: The lengths of the four sides of the license plate image are obtained based on the coordinates of the first vertex, and the coordinates of the second vertex are obtained based on the coordinates of the four sides. The transformation matrix is obtained based on the coordinates of the first vertex and the coordinates of the second vertex; The license plate image is corrected by performing a perspective transformation on the license plate image based on the transformation matrix.
8. The method as described in claim 7, characterized in that, The process further includes obtaining the four side lengths of the license plate image based on the first vertex coordinates, and obtaining the second vertex coordinates based on the four side lengths. A first maximum value is determined from the first side length and the second side length of the license plate image, and a second maximum value is determined from the second side length and the third side length of the license plate image; The corrected coordinates of the second vertex are obtained using the first maximum value and the second maximum value.
9. A license plate recognition system, characterized in that, include: The acquisition module is configured to acquire the image to be identified and perform grayscale processing on the image to be identified to obtain a grayscale image; The cropping module is configured to obtain the first vertex coordinates of the license plate based on the grayscale image, and crop the license plate image from the image to be recognized according to the first vertex coordinates. The calculation module is configured to input the license plate image into a color recognition model and a character recognition model respectively for parallel calculation to obtain the color and characters of the license plate; The correction module is configured to correct and output the characters and colors of the license plate.
10. A computer device, comprising: At least one processor; as well as A memory storing a computer program executable on the processor, characterized in that the processor executes the program by performing the steps of the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Character and color combined recognition method of license plates
CN103207992A
License plate recognition method and device, computer equipment and storage medium
CN110414507A
License plate color recognition method and device, and medium
CN111860539A
License plate recognition method, device, and equipment and medium
CN112784840A
License plate type identification method and device
CN113642586A