Image correction methods, terminal devices, and computer-readable storage media

CN117854075BActive Publication Date: 2026-06-30DONGGUAN ZKTECO ELECTRONICS TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGGUAN ZKTECO ELECTRONICS TECH
Filing Date
2023-12-11
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In the process of image recognition, inaccurate fitting of license plate vertices leads to inaccurate license plate recognition.

Method used

By analyzing the image to be processed, the initial vertex corresponding to the license plate is determined, and the position information of the initial vertex is corrected to obtain the comprehensive vertex. The image is then adjusted so that the edge of the license plate is parallel to the edge of the image.

Benefits of technology

This improves the accuracy and reliability of license plate recognition, ensuring the accuracy and reliability of license plate information recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117854075B_ABST
    Figure CN117854075B_ABST
Patent Text Reader

Abstract

This application relates to the field of image processing technology, and provides an image correction method, terminal device, and computer-readable storage medium, comprising: analyzing an image to be processed to determine each initial vertex corresponding to the license plate included in the image to be processed, wherein the image to be processed is an image of the license plate captured by photography; for each initial vertex, correcting the position information of the initial vertex in the image to be processed to obtain each comprehensive vertex corresponding to the license plate; and adjusting the image to be processed based on each comprehensive vertex so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image. By identifying and optimizing each comprehensive vertex of the license plate in the image to be processed, and adjusting the image to be processed based on the comprehensive vertices, the license plate in the image to be processed can be effectively adjusted, completing the license plate correction, thereby improving the license plate recognition effect, and further improving the accuracy and reliability of the license plate information obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to an image correction method, a terminal device, and a computer-readable storage medium. Background Technology

[0002] With the continuous development of image recognition technology, it is now possible not only to identify people in images, but also to recognize text and other information within them. For example, image recognition technology can be used to identify license plates.

[0003] In related technologies, terminal devices can use segmentation algorithms to segment images, then perform edge analysis on each segmented sub-image to determine the edges corresponding to the license plate in the image. Afterward, the terminal device can fit the four vertices of the license plate based on the determined edges, and thus recognize the license plate based on the fitted vertices.

[0004] However, during the process of fitting the license plate vertex, factors such as the shooting angle can affect the accuracy of the fitted license plate vertex, resulting in inaccurate license plate recognition. Summary of the Invention

[0005] This application provides an image correction method, a terminal device, and a computer-readable storage medium, which can solve the problem of inaccurate license plate recognition.

[0006] In a first aspect, embodiments of this application provide an image correction method, including:

[0007] The image to be processed is analyzed to determine the initial vertices corresponding to the license plate included in the image to be processed. The image to be processed is an image of the license plate taken by photograph.

[0008] For each initial vertex, the position information of the initial vertex in the image to be processed is corrected to obtain the comprehensive vertices corresponding to the license plate;

[0009] Based on each comprehensive vertex, the image to be processed is adjusted so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image.

[0010] In one possible implementation of the first aspect, the position information of the initial vertices in the image to be processed is corrected to obtain the comprehensive vertices corresponding to the license plate, including:

[0011] Based on the connecting lines between any two adjacent initial vertices, the position information of each initial vertex is adjusted to obtain the temporary vertices corresponding to the license plate.

[0012] Based on each temporary vertex, the outline points of the license plate are classified, and multiple outline points corresponding to each edge line of the license plate are determined. The outline points are obtained in the process of determining the initial vertices.

[0013] Based on the multiple contour points corresponding to each edge line, the positions of each temporary vertex are corrected to obtain each composite vertex.

[0014] In one possible implementation of the first aspect, the position information of each initial vertex is adjusted based on the connecting line between any two adjacent initial vertices to obtain the temporary vertices corresponding to the license plate, including:

[0015] Select any two adjacent initial vertices from the initial vertices and establish a connection line between them.

[0016] Determine the reference point from each initial vertex based on the slope of each connecting line;

[0017] Based on the reference point, the other initial vertices are modified to obtain temporary vertices composed of the reference point and the modified initial vertices.

[0018] In one possible implementation of the first aspect, the contour points of the license plate are classified according to each temporary vertex to determine multiple contour points corresponding to each edge line of the license plate, including:

[0019] For each contour point, the edge line between the contour point and the corresponding license plate is determined based on the coordinate information of the contour point and the coordinate information of each temporary vertex.

[0020] Based on the coordinate information of each temporary vertex and the pre-set filtering formula, the contour points corresponding to each edge line are filtered.

[0021] In one possible implementation of the first aspect, the positions of each temporary vertex are corrected based on multiple contour points corresponding to each edge line to obtain each composite vertex, including:

[0022] Multiple virtual boundary lines are obtained by fitting multiple contour points corresponding to each edge line of the license plate;

[0023] Based on the angles between each virtual boundary line and each pre-set coordinate axis, the virtual boundary lines are adjusted to obtain the composite boundary lines;

[0024] The intersection points between the various comprehensive boundary lines are taken as comprehensive vertices.

[0025] In one possible implementation of the first aspect, the virtual boundary lines are adjusted according to the angles between each virtual boundary line and each pre-set coordinate axis to obtain the composite boundary line, including:

[0026] Obtain the included angle between the first set of virtual boundary lines, which consists of any two non-adjacent virtual boundary lines;

[0027] Based on the included angle between the first set of virtual boundary lines, the first set of virtual boundary lines are adjusted to obtain the first set of composite boundary lines;

[0028] Based on the included angle between the second set of virtual boundary lines, the second set of virtual boundary lines is adjusted to obtain the second set of composite boundary lines.

[0029] In one possible implementation of the first aspect, the image to be processed is analyzed to determine the initial vertices corresponding to the license plates included in the image, including:

[0030] The initial image is initialized according to the preset size to obtain the image to be processed;

[0031] The image to be processed is segmented using a pre-set segmentation network to obtain multiple sub-images;

[0032] By analyzing multiple sub-images, multiple contour points corresponding to the license plate edge are obtained;

[0033] Multiple initial vertices are determined based on multiple contour points.

[0034] In one possible implementation of the first aspect, after adjusting the image to be processed based on each synthesized vertex, the method further includes:

[0035] The adjusted image is then used to identify the license plate information corresponding to the license plate.

[0036] Secondly, embodiments of this application provide an image correction device, including:

[0037] The determination module is used to analyze the image to be processed and determine the initial vertices corresponding to the license plate included in the image to be processed. The image to be processed is an image of the license plate captured by a camera.

[0038] The correction module is used to correct the position information of each initial vertex in the image to be processed, so as to obtain the comprehensive vertices corresponding to the license plate.

[0039] The adjustment module is used to adjust the image to be processed based on each comprehensive vertex, so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image.

[0040] Thirdly, embodiments of this application provide a terminal device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the method in the first aspect or any possible implementation of the first aspect.

[0041] Fourthly, a computer-readable storage medium is provided, comprising: a computer program stored therein, which, when executed, performs the method of the first aspect or any possible implementation thereof.

[0042] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the method described in any one of the first aspects.

[0043] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0044] The beneficial effects of the embodiments in this application compared with the prior art are:

[0045] This application provides an image correction method that analyzes the image to be processed to determine the initial vertices corresponding to the license plate. For each initial vertex, its position information in the image to be processed is corrected to obtain the comprehensive vertices corresponding to the license plate. Then, based on these comprehensive vertices, the image to be processed is adjusted so that the edges of the license plate in the adjusted image are parallel to the edges of the adjusted image. By identifying and optimizing the comprehensive vertices of the license plate in the image to be processed, and adjusting the image based on these comprehensive vertices, the license plate in the image to be processed can be effectively adjusted, completing the license plate correction. This improves the license plate recognition effect and, consequently, enhances the accuracy and reliability of the obtained license plate information. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic flowchart of an image correction method provided in an embodiment of this application;

[0048] Figure 2 This is a schematic flowchart of another image correction method provided in an embodiment of this application;

[0049] Figure 3A This is a schematic diagram illustrating the effect of an image correction method provided in an embodiment of this application;

[0050] Figure 3B This is a schematic diagram illustrating the effect of another image correction method provided in the embodiments of this application;

[0051] Figure 4 This is a schematic diagram of the structure of an image correction device provided in an embodiment of this application;

[0052] Figure 5 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. Detailed Implementation

[0053] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0054] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0055] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0056] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0057] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0058] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0059] With the continuous development of image recognition technology, it is now possible not only to identify people in images, but also to recognize text and other information within them. For example, image recognition technology can be used to identify license plates.

[0060] In related technologies, terminal devices can use segmentation algorithms to segment images, then perform edge analysis on each segmented sub-image to determine the edges corresponding to the license plate in the image. Afterward, the terminal device can fit the four vertices of the license plate based on the determined edges, and thus recognize the license plate based on the fitted vertices.

[0061] However, during the process of fitting the license plate vertex, factors such as the shooting angle can affect the accuracy of the fitted license plate vertex, resulting in inaccurate license plate recognition.

[0062] Therefore, the image correction method provided in this application analyzes the image to be processed to determine the initial vertices corresponding to the license plate included in the image. For each initial vertex, the position information of the initial vertex in the image to be processed is corrected to obtain the comprehensive vertices corresponding to the license plate. Then, based on the comprehensive vertices, the image to be processed is adjusted so that the edges of the license plate in the adjusted image are parallel to the edges of the adjusted image. By identifying and optimizing the comprehensive vertices of the license plate in the image to be processed, and adjusting the image based on the comprehensive vertices, the license plate in the image to be processed can be effectively adjusted, completing the license plate correction, thereby improving the license plate recognition effect and thus improving the accuracy and reliability of the license plate information obtained.

[0063] The following describes an example of an image correction method provided in an embodiment of this application.

[0064] Figure 1 This is a schematic flowchart illustrating an image correction method provided in an embodiment of this application. It is intended as an example and not a limitation. This method can be applied to terminal devices. See also... Figure 1 The method includes:

[0065] Step 101: Analyze the image to be processed and determine the initial vertices corresponding to the license plates included in the image.

[0066] The image to be processed can be an image obtained by taking a picture of a license plate.

[0067] During the license plate recognition process, the terminal device can first analyze the image to be processed, including the license plate, to determine the position of each initial vertex corresponding to the license plate in the image to be processed. This allows the terminal device to correct the image to be processed based on each initial vertex in subsequent steps.

[0068] Specifically, the terminal device can first segment the image to be processed to obtain multiple sub-images, then preprocess the multiple sub-images, and analyze each preprocessed sub-image to determine multiple contour points corresponding to the edge of the license plate, thereby determining each initial vertex based on the multiple contour points.

[0069] Optionally, the terminal device can first initialize the initial image according to the preset size to obtain the image to be processed, and then segment the image to be processed through a pre-set segmentation network to obtain multiple sub-images. Thus, multiple sub-images can be analyzed to obtain multiple contour points corresponding to the license plate edge, and then multiple initial vertices can be determined based on the multiple contour points.

[0070] Specifically, the terminal device can first acquire the initial image output by the imaging device, and normalize the size of the initial image according to a pre-set size to obtain the image to be processed. Then, the terminal device can input the image to be processed into a pre-set segmentation network (such as the Unet segmentation network model), and the segmentation network will segment the image to be processed to output multiple sub-images.

[0071] Correspondingly, the terminal device can preprocess multiple sub-images to obtain multiple sub-images in binary format, and traverse each preprocessed sub-image to determine the starting point of the license plate edge based on the parameter value corresponding to each pixel in each sub-image.

[0072] Then, the terminal device can start from this starting point and use a boundary tracking algorithm to search for the contour points corresponding to the license plate edge in each sub-image in a counterclockwise direction, combining the parameter values ​​of each pixel and its adjacent pixels, thus forming a contour point set.

[0073] After obtaining the contour point set, the terminal device can traverse each contour point in the set and calculate the distance between any two contour points. The terminal device can then select the two contour points with the largest distance as the first set of initial vertices based on the multiple distances.

[0074] The terminal device can establish a diagonal based on the first set of initial vertices, and then traverse each contour point again to obtain the distance between each contour point and the diagonal. Thus, on both sides of the diagonal, a contour point that is farthest from the diagonal can be selected as the second set of initial vertices. Then, based on the first set of initial vertices and the second set of initial vertices, the four initial vertices corresponding to the license plate can be obtained.

[0075] For example, when searching for the starting point, the terminal device can first traverse each sub-image from the top left corner to the bottom left corner of the image to be processed. If it is detected that the parameter value of the neighboring left pixel of a certain pixel is 0 and the parameter value of the neighboring right pixel is 1, then the terminal device can take that pixel as the starting point.

[0076] Step 102: For each initial vertex, correct the position information of the initial vertex in the image to be processed to obtain the comprehensive vertices corresponding to the license plate.

[0077] After obtaining the initial vertices, the terminal device can further refine the positions of the initial vertices to obtain composite vertices. In subsequent steps, the terminal device can adjust the image to be processed based on the more accurate composite vertices.

[0078] The terminal device can first make preliminary adjustments to the initial vertices based on their coordinates to obtain temporary vertices. Then, based on these temporary vertices, the terminal device can classify the contour points and determine the license plate edge corresponding to each contour point. Finally, based on the contour points corresponding to the edges of the license plate, the terminal device can further refine the positions of the temporary vertices to obtain the composite vertices.

[0079] Accordingly, see Figure 2 This step 102 may include: step 102a, step 102b and step 102c.

[0080] Step 102a: Adjust the position information of each initial vertex according to the connecting line between any two adjacent initial vertices to obtain each temporary vertex corresponding to the license plate.

[0081] Based on the two sets of initial vertices obtained by the terminal device in step 101, the terminal device can select one initial vertex from each set of initial vertices, establish a connection line between the two initial vertices, and thus perform preliminary correction on each initial vertex through each connection line to obtain each temporary vertex.

[0082] Optionally, the terminal device can first select any two adjacent initial vertices from each initial vertex and establish a connection line between the two adjacent initial vertices. Then, based on the slope of each connection line, a reference point is determined from each initial vertex. Based on the reference point, other initial vertices can be corrected to obtain temporary vertices composed of the reference point and each corrected initial vertex.

[0083] Specifically, the terminal device can first connect any two adjacent initial vertices to obtain multiple connecting lines. Then, the terminal device can select any two unconnected connecting lines (such as the upper connecting line and the lower connecting line), calculate the slope of these two connecting lines, and thus obtain two reference points, which are temporary vertices, based on the calculated slopes.

[0084] If the terminal device selects the upper and lower connecting lines for calculation and finds that the slopes of both are greater than 0, then the initial vertices of the upper right and lower right corners can be used as reference points. Similarly, if the slopes of the upper and lower connecting lines are both less than 0, then the initial vertices of the upper left and lower left corners can be used as reference points. Furthermore, if the slopes of the upper and lower connecting lines are both equal to 0, then the initial vertices of the upper left and upper right corners, or the lower left and lower right corners, can be used as reference points.

[0085] Afterwards, the terminal device can determine the distance between each endpoint and the edge of the license plate based on the two endpoints of the upper connection line and the two endpoints of the lower connection line. Then, it can select the preferred edge from the upper and lower connection lines based on the distances. The initial vertex that has not yet been determined as a temporary vertex among the preferred edges can be used as the third temporary vertex.

[0086] Finally, based on the upper or lower connecting line where the last initial vertex is located, a temporary vertex corresponding to the upper or lower connecting line is established, and a filtering line is established between the temporary vertex and each contour point around the last initial vertex. The slope corresponding to each filtering line is obtained, and combined with the reference slope of the connecting line between the other two temporary vertices, the target slope that is closest to the reference slope is selected from the slopes corresponding to multiple filtering lines. Thus, the contour point corresponding to the target slope can be used as the fourth temporary vertex to complete the adjustment of each initial vertex.

[0087] Step 102b: Classify the outline points of the license plate according to each temporary vertex, and determine the multiple outline points corresponding to each edge line of the license plate.

[0088] Among them, the contour points are obtained by the terminal device during the process of determining the initial vertices in step 101.

[0089] After determining each temporary vertex, the terminal device can classify each contour point according to each temporary vertex and determine the contour point corresponding to each edge line of the license plate. In subsequent steps, the terminal device can fit each virtual boundary line according to each contour point and determine each comprehensive vertex.

[0090] Optionally, for each contour point, the terminal device can determine the edge line of the contour point and the corresponding license plate based on the coordinate information of the contour point and the coordinate information of each temporary vertex, and then filter the contour points corresponding to each edge line based on the coordinate information of each temporary vertex and the pre-set filtering formula.

[0091] Specifically, the terminal device can first determine the two diagonals corresponding to the four temporary vertices according to a pre-set formula, and calculate the distance between each contour point and the two diagonals. Thus, based on the two calculated distance parameters, the edge line of the license plate corresponding to the contour point can be determined.

[0092] For example, if the two diagonals determined by the four temporary vertices are y1 = k1x + b1 and y2 = k2x + b2, and the distance between a certain contour point and y1 is d1 and the distance between it and y2 is y2, then the edge line corresponding to the contour point can be determined according to Table 1 below.

[0093] Table 1

[0094] d1>0 and d2>0 d1<0 and d2>0 d1>0 and d2<0 d1<0 and d2<0 bottom edge left edge right edge upper edge

[0095] Step 102c: Based on the multiple contour points corresponding to each edge line, correct the position of each temporary vertex to obtain each comprehensive vertex.

[0096] After determining the contour points corresponding to each edge line of the license plate, the terminal device can determine the composite vertex based on each contour point. In subsequent steps, the terminal device can adjust the image to be processed based on each composite vertex.

[0097] Optionally, the terminal device can fit multiple contour points corresponding to each edge line of the license plate to obtain multiple virtual boundary lines. Then, based on the angle between each virtual boundary line and each pre-set coordinate axis, the virtual boundary lines can be adjusted to obtain a comprehensive boundary line. The intersection point between the comprehensive boundary lines can then be used as the comprehensive vertex.

[0098] Specifically, the terminal device can first fit virtual boundary lines located on the top and bottom edges of the license plate based on the contour points corresponding to the top and bottom edges, respectively. Then, the terminal device can calculate the distances between the contour points corresponding to the left and right edges of the license plate and the virtual boundary lines on the top and bottom edges.

[0099] If the calculated distance is less than a preset distance threshold, the terminal device can delete the contour point; if the calculated distance is greater than or equal to the preset distance threshold, the terminal device can retain the contour point.

[0100] Correspondingly, the terminal device can fit virtual boundary lines located on the left and right sides of the license plate based on the retained contour points, and extend the fitted virtual boundary lines so that they intersect, thus using each intersection point as a comprehensive vertex.

[0101] Furthermore, in order to improve the accuracy of the composite vertex, the terminal device can also optimize each virtual boundary line, thereby using the optimized virtual boundary line as the composite boundary line, and then determining the composite vertex based on each composite boundary line.

[0102] Optionally, the terminal device can first obtain the included angle between the first set of virtual boundary lines, and adjust the first set of virtual boundary lines according to the included angle between the first set of virtual boundary lines to obtain the first set of comprehensive boundary lines.

[0103] The first set of virtual boundary lines can be composed of any two non-adjacent virtual boundary lines. Similarly, the second set of virtual boundary lines can be composed of two other virtual boundary lines besides the first set.

[0104] Then, the terminal device can adjust the second set of virtual boundary lines according to the included angle between the two sets of virtual boundary lines to obtain the second set of composite boundary lines, and then take the intersection of each composite boundary line as the composite vertex.

[0105] Specifically, the terminal device can first obtain the angle between two virtual boundary lines in the first set of virtual boundary lines. If the angle is less than a preset angle threshold, the terminal device does not need to adjust the first set of virtual boundary lines.

[0106] If the included angle is greater than or equal to a preset included angle threshold, the terminal device can first obtain the distance between each virtual boundary line and the edge of the image to be processed, and select the virtual boundary line corresponding to the larger distance parameter as the reference boundary line. If the distances between two virtual boundary lines and the edge of the image to be processed are equal, either virtual boundary line can be selected as the reference boundary line.

[0107] Subsequently, the terminal device can adjust the slope of the other virtual boundary line based on the slope of the baseline boundary line, making the slopes of the two virtual boundary lines equal. Furthermore, the terminal device can calculate two intercepts based on the two endpoints of the other virtual boundary line. The terminal device can then adjust the other virtual boundary line based on the smaller intercept, thereby using the baseline boundary line and the adjusted virtual boundary line as the first set of composite boundary lines.

[0108] For example, the intercept of another virtual boundary line calculated by the terminal device based on the baseline boundary line is bn = y - kn * x, where x and y represent the x-coordinate and y-coordinate of a certain endpoint of the other virtual boundary line, respectively, kn is the slope of the baseline boundary line, and bn is the intercept of the other virtual boundary line.

[0109] Similarly, the terminal device can also determine whether the second set of virtual boundary lines needs adjustment based on the angle between two virtual boundary lines in the second set. If the angle is less than a preset angle threshold, the terminal device does not need to adjust the second set of virtual boundary lines.

[0110] If the included angle is greater than or equal to a preset included angle threshold, the terminal device can determine the first influence factor based on the average distance between each contour point corresponding to the second set of virtual boundary lines and the corresponding virtual boundary line. Furthermore, the terminal device can determine the second influence factor based on the number of contour points corresponding to each virtual boundary line in the second set of virtual boundary lines.

[0111] Furthermore, the terminal device can calculate a third influence factor based on the slope of the first set of comprehensive boundary lines, combined with the first and second influence factors. Then, the terminal device can select a virtual boundary line from the second set of virtual boundary lines as the baseline boundary line based on the first, second, and third influence factors.

[0112] The terminal device can adjust another virtual boundary line in the second group of virtual boundary lines based on the determined baseline boundary line. Specifically, the terminal device can adjust the other virtual boundary line in the second group of virtual boundary lines in a similar manner to adjusting the other virtual boundary line in the first group; alternatively, it can adjust the baseline boundary line and the other virtual boundary line based on the angle bisector of the angle between them. This embodiment does not specifically limit the adjustment method for the second group of virtual boundary lines.

[0113] Step 103: Adjust the image to be processed based on each comprehensive vertex so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image.

[0114] After optimizing and obtaining the comprehensive vertices of the license plate, the terminal device can adjust the image to be processed based on each comprehensive vertex, thereby adjusting the position of the license plate in the image to be processed. This ensures that the edges of the adjusted license plate are parallel to the edges of the adjusted image, so that the effectiveness and accuracy of license plate recognition can be improved in subsequent steps.

[0115] Specifically, for any two adjacent composite vertices, the terminal device can obtain the coordinates of the two composite vertices, determine the coordinate difference between the x-coordinate and y-coordinate of the two composite vertices, and select the x-coordinate or y-coordinate corresponding to the smaller coordinate difference value for adjustment. Then, the terminal device can use the adjusted two composite vertices as a reference to adjust the remaining two composite vertices.

[0116] Correspondingly, the terminal device can merge or expand each pixel of the image to be processed based on the adjusted composite vertices and the adjustment distance and direction corresponding to each vertex, thereby obtaining the adjusted image.

[0117] For example, if the coordinates of two composite vertices obtained by the terminal device are (a1, b1) and (a2, b2), and the absolute value of the difference between a1 and a2 is less than the absolute value of the difference between b1 and b2, then the terminal device can adjust a1 and a2. If a2 is greater than a1, then the coordinates of the two adjusted composite vertices can be (a1 + (a1 + a2 / 2), b1) and (a2 - (a1 + a2 / 2), b2), respectively.

[0118] Step 104: Recognize the adjusted image to obtain the license plate information corresponding to the license plate.

[0119] Corresponding to step 103, after the terminal device has adjusted the image to be processed, it can input the adjusted image into a pre-set recognition model, and use the recognition model to recognize the adjusted image to obtain the license plate information in the adjusted image, thus completing the license plate recognition.

[0120] It should be noted that this application embodiment takes the recognition of the adjusted image by the terminal device as an example. In actual applications, the terminal device can also send the adjusted image to the server, and the server can recognize the adjusted image and receive the license plate information fed back by the server to complete the recognition of the license plate. This application embodiment does not specifically limit the method of recognizing the adjusted image.

[0121] like Figure 3A As shown in the illustration, this application provides a schematic diagram of the effect of an image correction method. Figure 3B As shown in the illustration, this application provides a schematic diagram illustrating the effect of another image correction method. Figure 3A and Figure 3B The first row shows license plates corrected using the techniques described in the background section of this application. It can be seen that the fitted vertices of the license plates are inaccurate. The images on the left of the second row are after license plate segmentation and binarization, while the images on the right of the second row show the fitting of contour points and edge lines. The images in the third row show license plates with corrected vertices obtained using the image correction method provided in this application. It can be seen that, compared with related techniques, the vertices of the license plates fitted using the image correction method provided in this application are more accurate.

[0122] In summary, the image correction method provided in this application analyzes the image to be processed, determines the initial vertices corresponding to the license plate in the image, and corrects the position information of each initial vertex in the image to be processed to obtain the comprehensive vertices corresponding to the license plate. Then, based on these comprehensive vertices, the image to be processed is adjusted so that the edges of the license plate in the adjusted image are parallel to the edges of the adjusted image. By identifying and optimizing the comprehensive vertices of the license plate in the image to be processed, and adjusting the image based on these comprehensive vertices, the license plate in the image to be processed can be effectively adjusted, completing the license plate correction, thereby improving the license plate recognition effect and ultimately improving the accuracy and reliability of the obtained license plate information.

[0123] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0124] Corresponding to the image correction method described in the above embodiments, Figure 4 A structural block diagram of the image correction device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0125] Reference Figure 4 The device includes:

[0126] The determination module 301 is used to analyze the image to be processed and determine the initial vertices corresponding to the license plate included in the image to be processed. The image to be processed is an image obtained by taking a picture of the license plate.

[0127] The correction module 302 is used to correct the position information of each initial vertex in the image to be processed, so as to obtain the comprehensive vertices corresponding to the license plate.

[0128] The adjustment module 303 is used to adjust the image to be processed based on each comprehensive vertex, so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image.

[0129] In summary, the image correction device provided in this application analyzes the image to be processed, determines the initial vertices corresponding to the license plate in the image, and corrects the position information of each initial vertex in the image to be processed to obtain the comprehensive vertices corresponding to the license plate. Then, based on these comprehensive vertices, the image to be processed is adjusted so that the edges of the license plate in the adjusted image are parallel to the edges of the adjusted image. By identifying and optimizing the comprehensive vertices of the license plate in the image to be processed, and adjusting the image based on these comprehensive vertices, the license plate in the image to be processed can be effectively adjusted, completing the license plate correction, thereby improving the license plate recognition effect and ultimately improving the accuracy and reliability of the obtained license plate information.

[0130] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0132] Based on the same inventive concept, this application also provides a terminal device. Figure 5 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application, such as... Figure 5 As shown, the terminal device provided in this embodiment includes a memory 41 and a processor 42. The memory 41 is used to store a computer program 43; the processor 42 is used to execute the method described in the above method embodiment when the computer program 43 is invoked.

[0133] The terminal device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so they will not be described again here.

[0134] This application also provides a terminal device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.

[0135] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.

[0136] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments.

[0137] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0138] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0139] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0140] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. An image correction method characterized by, The method includes: The image to be processed is analyzed to determine the initial vertices corresponding to the license plate included in the image to be processed, wherein the image to be processed is an image obtained by taking a picture of the license plate; For each of the initial vertices, Select any two adjacent initial vertices from each of the initial vertices, and establish a connection line between any two adjacent initial vertices; A reference point is determined from each of the initial vertices based on the slope of each of the connecting lines. Based on the reference point, the other initial vertices are corrected to obtain temporary vertices composed of the reference point and the corrected initial vertices; For each contour point, the edge line of the corresponding license plate is determined based on the coordinate information of the contour point and the coordinate information of each temporary vertex. The contour point is obtained in the process of determining the initial vertex. Based on the coordinate information of each temporary vertex and the pre-set filtering formula, the contour points corresponding to each edge line are filtered. Multiple virtual boundary lines are obtained by fitting multiple contour points corresponding to each edge line of the license plate; Obtain the included angle between the first set of virtual boundary lines, which consists of any two non-adjacent virtual boundary lines; Based on the included angle between the first set of virtual boundary lines, the first set of virtual boundary lines are adjusted to obtain the first set of composite boundary lines; Based on the included angle between the second set of virtual boundary lines, the second set of virtual boundary lines are adjusted to obtain the second set of composite boundary lines; The intersection points between the various integrated boundary lines are taken as integrated vertices; Based on each of the comprehensive vertices, the image to be processed is adjusted so that the edge of the license plate in the adjusted image is parallel to the edge of the adjusted image.

2. The method of claim 1, wherein, The analysis of the image to be processed, determining the initial vertices corresponding to the license plates included in the image to be processed, includes: The initial image is initialized according to the preset size to obtain the image to be processed; The image to be processed is segmented using a pre-set segmentation network to obtain multiple sub-images; By analyzing multiple sub-images, multiple contour points corresponding to the edge of the license plate are obtained; Based on the multiple contour points, a plurality of initial vertices are determined.

3. The method according to claim 1 or 2, characterized in that, After adjusting the image to be processed based on each of the composite vertices, the method further includes: The adjusted image is then identified to obtain the license plate information corresponding to the license plate.

4. A terminal device, characterized by comprising: include: A memory and a processor, the memory being used to store a computer program; the processor being used to execute the method as described in any one of claims 1-3 when the computer program is invoked.

5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 3.