A method, apparatus, device, medium and product for identifying a sign
By combining corner correction and deep learning template interpolation correction models with character recognition algorithms, the problem of low accuracy in recognizing tilted signs was solved, achieving higher recognition accuracy and lower labor costs.
Patent Information
- Application Number
- CN202310678608.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-06-08
AI Technical Summary
Existing methods for recognizing signs have low accuracy due to shooting angle issues, especially when the background is complex and the text information in the image is redundant, making it difficult to accurately recognize tilted signs.
The image is corrected using a corner correction algorithm and a deep learning template interpolation correction model. The two character recognition algorithms are combined to obtain the final recognition result. By correcting the image using corner correction and the deep learning template interpolation correction model, the influence of image tilt is reduced and the recognition accuracy is improved.
It improves the accuracy of sign recognition, reduces labor costs, minimizes redundant information interference, and ensures the accuracy of recognition results.
Smart Images

Figure CN116563857B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device, medium and product for recognizing signs. Background Technology
[0002] With the rapid development of smart logistics and smart cities, the demand for accurate shop location and navigation is becoming increasingly apparent. Traditional map information, which relies on manual collection, suffers from drawbacks such as slow updates, high costs, and insufficient timeliness. When shop information changes, navigation maps need to be updated accordingly, and how to quickly update map shop information has become a major technical challenge.
[0003] The conventional scene text recognition process is as follows: segment the shop signs in the image to extract the image area information of the shop signs with text, directly perform text detection and recognition on the image to obtain all text information in the image, then find the intersection of the two to obtain the text information of the shop signs, and then extract the shop information through natural language processing. However, due to the shooting angle, the collected shop sign images are tilted, which leads to low accuracy in text recognition. Summary of the Invention
[0004] This specification provides a method, apparatus, device, medium, and product for identifying signs, in order to solve the problem of low identification accuracy in existing sign identification methods.
[0005] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:
[0006] This specification provides an embodiment of a method for identifying signs, which may include:
[0007] Acquire the first image containing the sign to be identified;
[0008] The first image is corrected using a corner-based correction algorithm to obtain a first corrected image;
[0009] The first corrected image is identified using a first character recognition algorithm to obtain a first recognition result for the first corrected image;
[0010] A deep learning template interpolation correction model is used to correct the first image to obtain a second corrected image;
[0011] The second character recognition algorithm is used to recognize the second corrected image to obtain a second recognition result for the second corrected image;
[0012] Based on the first recognition result and the second recognition result, the final recognition result of the first image is obtained.
[0013] The device for identifying signs provided in the embodiments of this specification may include:
[0014] The first image acquisition module is used to acquire a first image containing the sign to be identified;
[0015] The first correction module is used to correct the first image using a corner-based correction algorithm to obtain a first corrected image.
[0016] The first recognition module is used to recognize the first corrected image using a first character recognition algorithm to obtain a first recognition result of the first corrected image;
[0017] The second correction module is used to correct the first image using a deep learning template interpolation correction model to obtain a second corrected image;
[0018] The second recognition module is used to recognize the second corrected image using a second character recognition algorithm to obtain a second recognition result of the second corrected image;
[0019] The recognition result acquisition module is used to obtain the final recognition result of the first image based on the first recognition result and the second recognition result.
[0020] This specification provides an embodiment of a computer device that may include a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of a method for recognizing signs.
[0021] This specification provides an embodiment of a computer-readable storage medium / computer program product, on which a computer program or instructions are stored, which can be executed by a processor to implement a method for identifying signs.
[0022] At least one embodiment in this specification achieves the following beneficial effects: by acquiring first image information containing the sign to be identified, correcting the first image based on corner correction, and identifying the corrected first image to obtain a first identification result; alternatively, a deep learning template interpolation correction model can be used to correct the first image, identify the corrected second image to obtain a second identification result, and based on the two identification results, the final identification result of the first image is obtained. This ensures that the sign to be identified is no longer tilted, improving the accuracy of identification; and by determining the final identification result of the first image based on the two identification results, the final identification result obtained can be more accurate. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of the overall scheme architecture of a method for identifying signs provided in the embodiments of this specification in a practical application scenario;
[0025] Figure 2 This is a flowchart illustrating a method for identifying signs provided in an embodiment of this specification;
[0026] Figure 3 This specification provides an embodiment of a method for correcting images based on a deep learning template interpolation correction model.
[0027] Figure 4 This is a schematic diagram of the structure of a sign recognition device provided in the embodiments of this specification;
[0028] Figure 5 This is a schematic diagram of the structure of a device for identifying signs provided in the embodiments of this specification. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of one or more embodiments of this specification.
[0030] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0031] In existing technologies, traditional scene text recognition for shop sign identification has high requirements. It is prone to inaccurate recognition in situations with complex backgrounds, redundant text information in images, or when the image of the shop sign is tilted due to the angle and perspective limitations of vehicle-mounted cameras. Furthermore, the information flow is lengthy, including image detection and segmentation, image text recognition, and natural language processing. These factors make it difficult to improve the sensitivity (recall) of identifying information of interest in natural environments. The tilted shooting angle is a significant constraint; traditional natural text detection and recognition technologies are limited by the viewing angle, and the precision and recall of text recognition are inversely correlated with the tilt angle of the text image. This results in low accuracy for recognizing tilted signs in images.
[0032] To address the shortcomings of existing technologies, this solution provides the following embodiments:
[0033] Figure 1 This is a schematic diagram of the overall architecture of a method for identifying signs in an embodiment of this specification in a practical application scenario.
[0034] like Figure 1 As shown, the scheme mainly includes: a first image 1 containing the sign to be identified, a server 2, and a recognition result 3. The first image 1 can be acquired manually or by using a vehicle-mounted camera. The server 2 can acquire the first image 1 and can correct and recognize the first image 1 using two different methods. Based on the recognition results of the two different methods, the output recognition result 3 is determined.
[0035] Figure 2 This is a flowchart illustrating a method for identifying signs provided in an embodiment of this specification. From a programming perspective, the entity executing the process can be a program hosted on an application server or an application client.
[0036] like Figure 2 As shown, the process may include the following steps:
[0037] Step 202: Obtain the first image containing the sign to be identified.
[0038] In the embodiments of this specification, the sign to be identified in the first image may include various types of plaques, billboards, and signs with directional functions, etc. The first image may contain one or more signs to be identified. The first image may be an image taken while the vehicle is in motion, or it may be a stored historical image.
[0039] Step 204: Use a corner-based correction algorithm to correct the first image to obtain a first corrected image.
[0040] In the embodiments of this specification, corner points can represent the vertices of the sign to be identified. The first corrected image can represent the corrected image of the sign to be identified. The size of the first corrected image can be different from the size of the first image. The server can obtain the corner points of the sign to be identified from the first image, and correct the sign based on the corner points, so that the sign is no longer tilted and is not affected by the shooting angle, which facilitates text detection and text recognition.
[0041] Step 206: Use the first character recognition algorithm to recognize the first corrected image and obtain the first recognition result of the first corrected image.
[0042] In this embodiment, an Optical Character Recognition (OCR) algorithm can be used to recognize text information in the first corrected image. The OCR algorithm can recognize common characters and also locate them. Furthermore, after OCR recognition, the output is machine-readable information, requiring no additional data annotation. This means that manual processing of unprocessed primary data, including images and text, is unnecessary, reducing labor costs. The first recognition result can also be obtained by recognizing the first corrected image using other existing character recognition algorithms, preferably the OCR algorithm. Users can choose the corresponding recognition algorithm according to their needs. After the server recognizes the first corrected image using the first character recognition algorithm, in addition to outputting the first recognition result, it will also output the first total confidence score corresponding to the first recognition result, or the confidence score of each character in the first recognition result.
[0043] Step 208: Use a deep learning template interpolation correction model to correct the first image to obtain a second corrected image.
[0044] The second corrected image in the embodiments of this specification can also be an image containing only the corrected sign image, without containing other image information unrelated to the sign, reducing redundant information in the image to be recognized, reducing interference, and improving recognition accuracy. The deep learning template interpolation correction model can use the Thin Plate Spline (TPS) algorithm to correct the first image, or it can use other existing interpolation algorithms. This model can be trained by gradient backpropagation using the loss function generated by text recognition, making the recognition result of the corrected image more accurate.
[0045] Step 210: Use the second character recognition algorithm to recognize the second corrected image to obtain the second recognition result of the second corrected image.
[0046] The second character recognition algorithm in the embodiments of this specification can use the same character recognition algorithm as the first character recognition algorithm, such as using an OCR algorithm to recognize the image. After recognition using the second character recognition algorithm, not only will a second recognition result be output, but also a corresponding second total confidence score or the confidence score of a single character will be output. Due to different correction methods, the resulting corrected images may have some differences, so the second recognition result may be different from or the same as the first recognition result.
[0047] Step 212: Based on the first recognition result and the second recognition result, obtain the final recognition result of the first image.
[0048] In the embodiments of this specification, if the first recognition result and the second recognition result are the same, one of the recognition results can be selected as the result of sign text recognition; if the first recognition result and the second recognition result are different, the confidence of the two recognition results can be combined to make the final sign text recognition result more accurate, thereby improving the accuracy of the obtained sign information.
[0049] It should be understood that the order of some steps in the methods described in one or more embodiments of this specification may be interchanged according to actual needs, or some steps may be omitted or deleted.
[0050] Figure 2 The method described above acquires a first image containing the sign to be identified, corrects the first image using a corner correction method, and then identifies the corrected first image to obtain a first identification result. Simultaneously, a deep learning template interpolation correction model can also be used to correct the first image, and the corrected second image can be identified to obtain a second identification result. Based on these two identification results, the final identification result for the first image is obtained. This method ensures that the sign to be identified is no longer tilted, improving the accuracy of identification; furthermore, determining the final identification result for the first image based on the two identification results makes the final identification result even more accurate.
[0051] based on Figure 2 In addition to the method described herein, this specification also provides some specific implementation methods of this method, which will be described below.
[0052] The first image can be corrected based on the corner coordinates of the sign to be identified and using homography transformation. Optionally, the corner-based correction algorithm described in the embodiments of this specification for correcting the first image to obtain a first corrected image may specifically include:
[0053] The first image is segmented using a segmentation algorithm to obtain the segmented region corresponding to the sign to be identified;
[0054] Calculate the coordinates of a set number of corner points in the segmented region using a Cartesian coordinate system;
[0055] Based on the coordinates of the set number of corner points, calculate the homography transformation matrix corresponding to the segmented region;
[0056] Based on the homography transformation matrix, the segmented region is subjected to homography transformation to obtain the first corrected image.
[0057] The segmentation algorithm in this embodiment can extract the image region of the sign to be identified based on a segmentation mask. The segmentation mask represents a first image where the image values of the sign to be identified remain unchanged, but the image values of other regions in the first image besides the sign to be identified are set to 0. The server can establish a Cartesian coordinate system with the center of the sign image region as the origin, the direction parallel to the upper and lower boundaries of the first image as the x-axis, and the direction parallel to the left and right boundaries of the first image as the y-axis. The rightward direction can be the positive direction of the x-axis, and the downward direction as the positive direction of the y-axis. A set number of corner points can be calculated based on this Cartesian coordinate system. The set number can be 4, 5, 6, etc. Since signs are mostly square, a set number of 4 yields better results. The homography transformation matrix can be obtained using the Random Sample Consensus (RANSAC) algorithm, where a set number of corner points can be used as samples for RANSAC algorithm calculation. The homography transformation matrix can be used to transform the image region of the sign to be identified in the first image to another plane, so that the image of the other plane after transformation is the corrected image of the sign to be identified, i.e., the first corrected image.
[0058] The corner positions of the sign to be identified can be determined based on a straight line with a preset slope, and the positions can be corrected to obtain the preset corrected corner positions of the image. Optionally, the calculation of the coordinates of a set number of corner points of the segmented region based on the Cartesian coordinate system described in the embodiments of this specification may specifically include:
[0059] The segmented region is divided into a first part and a second part according to a first straight line with a preset slope.
[0060] Calculate the first extreme point in the first part that is farthest from the first straight line;
[0061] Calculate the second extreme point in the second part that is farthest from the first straight line;
[0062] The segmented region is divided into a third part and a fourth part according to the second straight line; the second straight line is perpendicular to the first straight line.
[0063] Calculate the third extreme point in the third part that is farthest from the second straight line;
[0064] Calculate the fourth extreme point in the fourth part that is farthest from the second straight line;
[0065] Based on the first extreme point, the second extreme point, the third extreme point, and the fourth extreme point, the length and width of the sign to be identified are obtained;
[0066] The coordinates of the set number of corner points are determined based on the length and width values.
[0067] In the embodiments of this specification, the preset slope of the first straight line can be 1. This means the server can use a straight line with a slope of 1 to divide the sign to be identified into two parts: a first part and a second part. When dividing the segmented area, it doesn't matter whether the first straight line passes through the origin; as long as the first straight line divides the sign to be identified into two parts, it's sufficient. The first extreme point can be the point farthest from the first straight line, obtained by comparing the distances of each point in the first part to the first straight line. Similarly, the second extreme point can be the point farthest from the first straight line, obtained by comparing the distances of each point in the second part to the first straight line. The second straight line is perpendicular to the first straight line, meaning its slope can be -1. Therefore, the third and fourth extreme points can be obtained using the same method as for the first straight line. The length and width of the sign to be identified can be calculated based on the coordinates of the extreme points, and the coordinates of the set corner points of the corrected image can be determined based on the length and width values.
[0068] To minimize the impact of the corrected sign on image text recognition, the accuracy of the corner points of the corrected sign can be improved based on its side length, thus ensuring that the corrected image does not affect text recognition. Optionally, obtaining the length and width of the sign to be recognized as described in the embodiments of this specification may specifically include:
[0069] Based on the coordinates of each extreme point, calculate the first length and the second length of the segmented region; the first length represents the length of the upper boundary line of the sign to be identified; the second length represents the length of the lower boundary line of the sign to be identified.
[0070] The mean of the first length and the second length is calculated to obtain the corrected length of the sign to be identified;
[0071] Based on the coordinates of each extreme point, calculate the first width and the second width of the segmented region; the first width represents the length of the left boundary line of the sign to be identified; the second width represents the length of the right boundary line of the sign to be identified.
[0072] Calculate the average of the first width and the second width to obtain the corrected width of the sign to be identified;
[0073] Determining the coordinates of the predetermined number of corner points based on the length and width values may specifically include:
[0074] The coordinates of each extreme point are corrected based on the correction length and the correction width.
[0075] The corrected coordinates of each extreme point are used as the coordinates of the set number of corner points.
[0076] In this embodiment of the specification, to facilitate the calculation of the side length information of the sign, the extreme points can be sorted. Taking four extreme points as an example, starting from the extreme point in the upper left corner, the four extreme points can be sorted clockwise to obtain C1, C2, C3, and C4. Then, the edges formed by C1 and C2, and C3 and C4, can be identified as the upper and lower boundaries of the sign to be identified; the edges formed by C1 and C4, and C2 and C3, can be identified as the left and right boundaries of the sign to be identified. This makes it easier to calculate the lengths of the upper and lower boundaries and the left and right boundaries of the sign to be identified in the first image. The sorting can also be done in other ways, as long as it easily reflects the positional relationship between each extreme point and the sign to be identified. For example, the extreme point in the lower left corner can be used as the starting point, and the points can be arranged counterclockwise, etc.
[0077] In this embodiment of the specification, to ensure that the upper and lower boundary lengths and the left and right boundary lengths of the corrected image are consistent, the boundary lengths of the corrected image can be calculated based on the coordinates of each extreme point. The first length of the sign to be identified in the first image can be obtained by calculating the distance between two extreme points located at the upper boundary; the second length of the sign to be identified in the first image can be obtained by calculating the distance between two extreme points located at the lower boundary; the server can calculate the average length based on the first and second lengths, and use this average length as the length of the upper and lower boundaries of the corrected sign to be identified, i.e., the corrected length. Similarly, the first width of the sign to be identified in the first image can be obtained by calculating the distance between two extreme points located at the left boundary; the second width of the sign to be identified in the first image can be obtained by calculating the distance between two extreme points located at the right boundary; the server can use the average of the first and second widths as the length of the left and right boundaries of the corrected sign to be identified, i.e., the corrected width. Then, based on the coordinates of each extreme point corresponding to the corrected width and corrected length, the server can determine the coordinates of each corner point of the corrected sign to be identified.
[0078] Taking the extreme points after the above sorting as an example, the correction length L and correction width H can be calculated from the coordinates of C1, C2, C3 and C4. Then, the coordinates of C1 can be corrected to (0,0), the coordinates of C2 can be corrected to (L,0), the coordinates of C3 can be corrected to (L,H), and the coordinates of C4 can be corrected to (0,H). These corrected coordinates are used as the coordinates of each corner point of the sign to be identified after correction.
[0079] In practical applications, in order to make the text recognition results of the corrected image obtained by homography transformation more accurate, when calculating the homography transformation matrix, the coordinates of each extreme point before correction and the coordinates of each extreme point after correction can be used as samples of the RANSAC algorithm to calculate the homography transformation matrix, so that the text recognition results of the image obtained by homography transformation through this matrix are more accurate.
[0080] An interpolation function can be calculated based on points in the image, and then the first image can be corrected based on the interpolation function. Optionally, the deep learning template interpolation correction model described in the embodiments of this specification for correcting the first image to obtain a second corrected image may specifically include:
[0081] The first image is adjusted according to a preset size to obtain the adjusted second image;
[0082] Obtain a preset number of first key points; the first key points include key points located at the upper and lower boundaries of the second image;
[0083] The image interpolation function is obtained based on the preset number of first key points;
[0084] The first image is corrected based on the image interpolation function to obtain the second corrected image.
[0085] In this embodiment, the first image can be resized to a preset size, such as 512*512 or 128*128, to obtain the second image. The specific size can be set by the user according to their needs and the model's adaptability. The server can use a keypoint prediction network to predict keypoints in the second image, obtaining a preset number of first keypoints located at the upper and lower boundaries, such as ten, eight, twelve, etc. The number of keypoints can be set by the user based on the image size or the required sample size. After calculating the interpolation function, the portion of the sign to be recognized in the first image can be used as the function input.
[0086] Optionally, the image interpolation function obtained based on the first key point as described in the embodiments of this specification may specifically include:
[0087] Obtain the preset number of endpoints from the sign to be identified in the second image; the endpoints include key points evenly distributed at the upper and lower boundaries of the sign to be identified in the second image;
[0088] Using the endpoints and the first keypoint as control points, the image interpolation function is calculated.
[0089] In this embodiment, the number of endpoints obtained from the sign to be identified in the second image is the same as the number of first key points. The number of endpoints on the upper boundary is the same as the number of endpoints on the lower boundary. These endpoints can be points evenly distributed along each boundary, including the start and end points of each edge. There is a one-to-one correspondence between the endpoints and the first key points, which can be understood as a positional correspondence. For example, the first endpoint on the upper left corresponds to the first first key point on the upper left, and the first endpoint on the lower right corresponds to the first first key point on the lower right. The first key points and endpoints can be used as control points. An interpolation function, such as a TPS interpolation function, is calculated using the offset distance and coordinates between corresponding points.
[0090] Optionally, the method of correcting the first image based on the image interpolation function to obtain the second corrected image in the embodiments of this specification may specifically include:
[0091] Obtain the preset number of second key points; the second key points include key points located at the upper and lower boundaries of the sign to be identified in the first image;
[0092] Based on the second key point, the sign to be identified is divided into several thin plates;
[0093] The thin plates are corrected according to the image interpolation function.
[0094] The corrected thin plates are combined to obtain the second corrected image.
[0095] In the embodiments of this specification, the second key point can also be a key point in the first image whose upper and lower boundaries are evenly distributed and contain a starting endpoint. To reduce the distortion of the corrected image, the four adjacent points of the second key point can be treated as a small thin plate. This thin plate is input into an image interpolation function to obtain the corrected thin plate. These thin plates are then combined into a complete image to obtain the second corrected image. To further reduce the distortion of the corrected image, the first key point and its endpoints can also be treated as control points using four pairs of adjacent points, and the interpolation function corresponding to each thin plate can be calculated.
[0096] Figure 3 This specification provides an embodiment of a method for image correction based on a deep learning template interpolation correction model. For example... Figure 3 As shown, 31 can represent the first input image, 32 can represent the second image after resizing, the black dots in 33 can represent the key points (endpoints) extracted from the sign to be identified in the second image, 34 represents the template interpolation algorithm, and 35 can represent the corrected sign image. Before the key points of the second image are input into the algorithm, the first key points of the upper and lower boundaries of the second image in 33 and the endpoints in 33 can also be extracted and input into the algorithm together with them to calculate the interpolation function. Before the first image 31 is input into the interpolation algorithm, the second key points of the sign to be identified in the first image can also be extracted. After the image is input into the interpolation algorithm, the interpolation algorithm can divide the sign to be identified in the first image into small thin plates according to the key points, which makes it easier to reduce the distortion of the integrated corrected image after the interpolation function calculation, or even obtain a non-distorted corrected image.
[0097] The final result of image recognition can be determined based on the confidence levels corresponding to the recognition results obtained from the two methods, and the final result can be processed. Optionally, the method described in this specification for obtaining the final recognition result of the first image based on the first recognition result and the second recognition result may specifically include:
[0098] Obtain the first total confidence level corresponding to the first recognition result;
[0099] Obtain the second total confidence level corresponding to the second recognition result;
[0100] If the first total confidence is greater than or equal to the second total confidence, the first recognition result is determined as the final recognition result;
[0101] If the first total confidence is less than the second total confidence, the second recognition result is determined as the final recognition result;
[0102] The method may further include:
[0103] Processing the final recognition result using a graph neural network model to obtain sign information of the sign to be recognized.
[0104] In the embodiments of this specification, the recognition result with higher total confidence can be used as the final image recognition result. In addition, it can also be first determined whether the number of characters in the first recognition result is consistent with the number of characters in the second recognition result. If they are consistent, the character with higher confidence can be selected according to the confidence of the two characters at the same position in the first image among the two recognition results, and the character with higher confidence among the two characters at the same position in the two recognition results can be comprehensively selected. If they are not consistent, the average confidence of the recognition result can be calculated according to the confidence of each character, and the recognition result with higher average confidence can be selected as the final result. The user can choose either of the two methods to process the first recognition result and the second recognition result. The server can use a graph neural network model to perform natural language processing on each character in the final recognition result, so that the processed characters can conform to the language structure and be easy for people to understand. For example, if character 1 is "food" and character 2 is "shop", the output information after language processing is "restaurant" instead of "shop food". The sentences, single characters or words output after natural language processing are used as sign information. By combining the two methods to recognize and process images, it can cope with various different scenarios. Even if the scenarios are complex or changeable, the text information in the images can be accurately recognized.
[0105] Through the above method, the tilted image can be corrected, so that the corrected image only contains the image of the sign to be recognized, so that during recognition, it will not be interfered by other information, the accuracy of image recognition is improved, and the recognized data does not require additional data annotation, which saves labor consumption.
[0106] Based on the same idea, the embodiments of this specification further provide an apparatus corresponding to the above method. Figure 4 It is a schematic structural diagram of an apparatus for recognizing a sign provided by an embodiment of this specification. As Figure 4 shown, the apparatus may include:
[0107] A first image acquisition module 402, configured to acquire a first image containing a sign to be recognized;
[0108] The first correction module 404 is used to correct the first image using a corner-point correction algorithm to obtain a first corrected image;
[0109] The first recognition module 406 is used to recognize the first corrected image using a first character recognition algorithm to obtain a first recognition result of the first corrected image;
[0110] The second correction module 408 is used to correct the first image using a deep learning template interpolation correction model to obtain a second corrected image;
[0111] The second recognition module 410 is used to recognize the second corrected image using a second character recognition algorithm to obtain a second recognition result of the second corrected image;
[0112] The recognition result acquisition module 412 is used to obtain the final recognition result of the first image based on the first recognition result and the second recognition result.
[0113] based on Figure 4 The embodiments of this specification also provide some specific implementation schemes of the method, which are described below.
[0114] Optionally, the first correction module may specifically include:
[0115] The first image segmentation unit is used to segment the first image using a segmentation algorithm to obtain the segmented region corresponding to the sign to be identified;
[0116] The corner coordinate calculation unit is used to calculate the coordinates of a set number of corner points in the segmented region based on a Cartesian coordinate system.
[0117] The homography transformation matrix calculation unit is used to calculate the homography transformation matrix corresponding to the segmented region based on the coordinates of the set number of corner points;
[0118] The first corrected image acquisition unit is used to perform homography transformation on the segmented region according to the homography transformation matrix to obtain the first corrected image.
[0119] Optionally, the corner coordinate calculation unit can be specifically used for:
[0120] The segmented region is divided into a first part and a second part according to a first straight line with a preset slope.
[0121] Calculate the first extreme point in the first part that is farthest from the first straight line;
[0122] Calculate the second extreme point in the second part that is farthest from the first straight line;
[0123] The segmented region is divided into a third part and a fourth part according to the second straight line; the second straight line is perpendicular to the first straight line.
[0124] Calculate the third extreme point in the third part that is farthest from the second straight line;
[0125] Calculate the fourth extreme point in the fourth part that is farthest from the second straight line;
[0126] Based on the first extreme point, the second extreme point, the third extreme point, and the fourth extreme point, the length and width of the sign to be identified are obtained;
[0127] The coordinates of the set number of corner points are determined based on the length and width values.
[0128] Optionally, the corner coordinate calculation unit can be specifically used for:
[0129] Based on the coordinates of each extreme point, calculate the first length and the second length of the segmented region; the first length represents the length of the upper boundary line of the sign to be identified; the second length represents the length of the lower boundary line of the sign to be identified.
[0130] The mean of the first length and the second length is calculated to obtain the corrected length of the sign to be identified;
[0131] Based on the coordinates of each extreme point, calculate the first width and the second width of the segmented region; the first width represents the length of the left boundary line of the sign to be identified; the second width represents the length of the right boundary line of the sign to be identified.
[0132] Calculate the average of the first width and the second width to obtain the corrected width of the sign to be identified;
[0133] The coordinates of each extreme point are corrected based on the correction length and the correction width.
[0134] The corrected coordinates of each extreme point are used as the coordinates of the set number of corner points.
[0135] Optionally, the second correction module may specifically include:
[0136] A size adjustment unit is used to adjust the first image according to a preset size to obtain an adjusted second image;
[0137] The first key point acquisition unit is used to acquire a preset number of first key points; the first key points include key points located at the upper and lower boundaries of the second image.
[0138] An interpolation function calculation unit is used to obtain an image interpolation function based on the preset number of first key points;
[0139] The second corrected image acquisition unit is used to correct the first image based on the image interpolation function to obtain the second corrected image.
[0140] Optionally, the interpolation function calculation unit can be specifically used for:
[0141] Obtain the preset number of endpoints from the sign to be identified in the second image; the endpoints include key points evenly distributed at the upper and lower boundaries of the sign to be identified in the second image;
[0142] Using the endpoints and the first keypoint as control points, the image interpolation function is calculated.
[0143] Optionally, the second corrected image acquisition unit may specifically be used for:
[0144] Obtain the preset number of second key points; the second key points include key points located at the upper and lower boundaries of the sign to be identified in the first image;
[0145] Based on the second key point, the sign to be identified is divided into several thin plates;
[0146] The thin plates are corrected according to the image interpolation function.
[0147] The corrected thin plates are combined to obtain the second corrected image.
[0148] Optionally, the recognition result acquisition module can be specifically used for:
[0149] Obtain the first total confidence level corresponding to the first recognition result;
[0150] Obtain the second total confidence level corresponding to the second recognition result;
[0151] If the first total confidence level is greater than or equal to the second total confidence level, then the first identification result is determined as the final identification result;
[0152] If the first total confidence level is less than the second total confidence level, then the second identification result is determined as the final identification result;
[0153] The device can also be used for:
[0154] The final recognition result is processed using a graph neural network model to obtain the sign information of the sign to be recognized.
[0155] Based on the same idea, this specification also provides devices corresponding to the above methods in its embodiments.
[0156] Figure 5 This is a schematic diagram of a device for identifying signs, provided as an embodiment of this specification. Figure 5 As shown, device 500 may include:
[0157] The system includes a memory 530, a processor 510, and a computer program 520 stored in the memory. The processor 510 executes the computer program 520 to implement the steps of the method for identifying signs as described in any of the above embodiments.
[0158] Based on the same approach, embodiments of this specification also provide a computer-readable storage medium / computer program product corresponding to the above-described method. The computer-readable storage medium / computer program product stores a computer program or instructions that can be executed by a processor to implement the above-described method for identifying signs.
[0159] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, for... Figure 5 As the device shown is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0160] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0161] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0162] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0163] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0164] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0165] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0168] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0169] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0170] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0171] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0172] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0174] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for identifying signs, characterized in that, include: Acquire the first image containing the sign to be identified; The first image is corrected using a corner-based correction algorithm to obtain a first corrected image; The first corrected image is identified using a first character recognition algorithm to obtain a first recognition result for the first corrected image; A deep learning template interpolation correction model is used to correct the first image to obtain a second corrected image; The second character recognition algorithm is used to recognize the second corrected image to obtain a second recognition result for the second corrected image; Based on the total confidence scores corresponding to the first and second recognition results, the final recognition result of the first image is obtained; The final identification result is the identification result corresponding to the maximum total confidence. The step of using a corner-based correction algorithm to correct the first image to obtain a first corrected image specifically includes: The first image is segmented using a segmentation algorithm to obtain the segmented region corresponding to the sign to be identified; The segmented region is divided into a first part and a second part according to a first straight line with a preset slope. Calculate the first extreme point in the first part that is farthest from the first straight line; Calculate the second extreme point in the second part that is farthest from the first straight line; The segmented region is divided into a third part and a fourth part according to the second straight line; the second straight line is perpendicular to the first straight line. Calculate the third extreme point in the third part that is farthest from the second straight line; Calculate the fourth extreme point in the fourth part that is farthest from the second straight line; Based on the first extreme point, the second extreme point, the third extreme point, and the fourth extreme point, the length and width of the sign to be identified are obtained; Based on the length and width values, determine the coordinates of the set number of corner points; Based on the coordinates of the set number of corner points, calculate the homography transformation matrix corresponding to the segmented region; Based on the homography transformation matrix, the segmented region is subjected to homography transformation to obtain the first corrected image.
2. The method as described in claim 1, characterized in that, Obtaining the length and width of the sign to be identified specifically includes: Based on the coordinates of each extreme point, calculate the first length and the second length of the segmented region; the first length represents the length of the upper boundary line of the sign to be identified; the second length represents the length of the lower boundary line of the sign to be identified. The mean of the first length and the second length is calculated to obtain the corrected length of the sign to be identified; Based on the coordinates of each extreme point, calculate the first width and the second width of the segmented region; the first width represents the length of the left boundary line of the sign to be identified; the second width represents the length of the right boundary line of the sign to be identified. Calculate the average of the first width and the second width to obtain the corrected width of the sign to be identified; Determining the coordinates of the predetermined number of corner points based on the length and width values specifically includes: The coordinates of each extreme point are corrected based on the correction length and the correction width. The corrected coordinates of each extreme point are used as the coordinates of the set number of corner points.
3. The method as described in claim 1, characterized in that, The step of using a deep learning template interpolation correction model to correct the first image and obtain a second corrected image specifically includes: The first image is adjusted according to a preset size to obtain the adjusted second image; Obtain a preset number of first key points; the first key points include key points located at the upper and lower boundaries of the second image; The image interpolation function is obtained based on the preset number of first key points; The first image is corrected based on the image interpolation function to obtain the second corrected image.
4. The method as described in claim 3, characterized in that, The step of obtaining the image interpolation function based on the first key point specifically includes: The preset number of endpoints are obtained from the sign to be identified in the second image; the endpoints include key points that are evenly distributed at the upper and lower boundaries of the sign to be identified in the second image. Using the endpoints and the first keypoint as control points, the image interpolation function is calculated.
5. The method as described in claim 3, characterized in that, The step of correcting the first image based on the image interpolation function to obtain the second corrected image specifically includes: Obtain the preset number of second key points; the second key points include key points located at the upper and lower boundaries of the sign to be identified in the first image; Based on the second key point, the sign to be identified is divided into several thin plates; The thin plates are corrected according to the image interpolation function. The corrected thin plates are combined to obtain the second corrected image.
6. The method as described in claim 1, characterized in that, The final recognition result of the first image is obtained based on the total confidence level corresponding to the first recognition result and the second recognition result, specifically including: Obtain the first total confidence level corresponding to the first recognition result; Obtain the second total confidence level corresponding to the second recognition result; If the first total confidence level is greater than or equal to the second total confidence level, then the first identification result is determined as the final identification result; If the first total confidence level is less than the second total confidence level, then the second identification result is determined as the final identification result; The method further includes: The final recognition result is processed using a graph neural network model to obtain the sign information of the sign to be recognized.
7. A device for identifying signs, characterized in that, include: The first image acquisition module is used to acquire a first image containing the sign to be identified; The first correction module is used to correct the first image using a corner-based correction algorithm to obtain a first corrected image. The first recognition module is used to recognize the first corrected image using a first character recognition algorithm to obtain a first recognition result of the first corrected image; The second correction module is used to correct the first image using a deep learning template interpolation correction model to obtain a second corrected image; The second recognition module is used to recognize the second corrected image using a second character recognition algorithm to obtain a second recognition result of the second corrected image; The recognition result acquisition module is used to obtain the final recognition result of the first image based on the total confidence scores corresponding to the first recognition result and the second recognition result; the final recognition result is the recognition result corresponding to the maximum total confidence score. The first correction module is specifically used to segment the first image using a segmentation algorithm to obtain the segmented region corresponding to the sign to be identified; and to divide the segmented region into a first part and a second part according to a first straight line with a preset slope; Calculate the first extreme point in the first part that is farthest from the first straight line; calculate the second extreme point in the second part that is farthest from the first straight line; The segmented region is divided into a third part and a fourth part according to the second straight line; the second straight line is perpendicular to the first straight line. Calculate the third extreme point in the third part that is farthest from the second straight line; calculate the fourth extreme point in the fourth part that is farthest from the second straight line; based on the first extreme point, the second extreme point, the third extreme point, and the fourth extreme point, obtain the length and width of the sign to be identified; determine the coordinates of a set number of corner points according to the length and width values; calculate the homography transformation matrix corresponding to the segmented region according to the coordinates of the set number of corner points. Based on the homography transformation matrix, the segmented region is subjected to homography transformation to obtain the first corrected image.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method for identifying signs according to any one of claims 1 to 6.
9. A computer-readable storage medium / computer program product having a computer program or instructions stored thereon, characterized in that, The computer program or instructions are executed by a processor to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
A blue license plate segmentation and correction method
CN109886896A
Character recognition method and device
CN111046859A
Method for improving quality of recognition of a single frame
US20190073571A1
Methods for optical character recognition (OCR)
US20190102649A1
