A method and system for correcting a yin-yang license plate
By obtaining the brightness and color information of the license plate image to perform regional segmentation, determine the type of positive and negative license plates, and adjust the brightness and color, the problems of resource occupation and low recognition accuracy in the processing of positive and negative license plates are solved, and an efficient license plate correction effect is achieved.
Patent Information
- Application Number
- CN202111502266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-12-09
AI Technical Summary
When processing yin-yang license plates, the existing technology loses the color information of the license plates and cannot effectively distinguish between yin-yang license plates, resulting in resource occupation and performance consumption.
By obtaining the brightness and color information of the license plate image, regional segmentation is performed to determine the license plate type, and the brightness and color of the positive and negative license plates are adjusted to finally combine them into a complete license plate image.
The accuracy of license plate recognition is improved, the algorithm complexity is reduced, the adaptability is strong, and it can effectively correct different degrees of yin and yang license plates.
Smart Images

Figure CN114140615B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of security and computer application, in particular to a method and system for correcting Yin and Yang license plates. BACKGROUND
[0002] In the field of intelligent traffic monitoring, the electric police and the fisheye camera can analyze and identify license plate information. Since the electric police and the fisheye camera are mainly installed on the road, they are greatly affected by the environmental light. For the electric police and the fisheye device, in some scenarios, as the sunlight changes at different times, the shadow of the building or the tree may appear on the snapshot, resulting in uneven brightness and color of the overall license plate, causing the phenomenon that the captured license plate is not uniform as a whole, and there are two parts with different brightness and color, i.e. Yin and Yang license plate.
[0003] At present, the method for correcting Yin and Yang license plate mainly uses Canny edge detection operator to extract Yin and Yang license plate, and only the brightness of the license plate characters in the binary image is corrected. However, this method has the following defects. On the one hand, this method only processes the binary image of the license plate, and loses the color information of the license plate, which is not conducive to subsequent detection and recognition. On the other hand, this method does not pre-determine whether the license plate is Yin and Yang license plate, so it will process all license plates, which will cause unnecessary resource occupation and performance consumption. SUMMARY
[0004] In view of the above-mentioned defects of the prior art, the present application provides a method and system for correcting Yin and Yang license plate to solve the above-mentioned technical problems.
[0005] The method for correcting Yin and Yang license plate provided by the present application comprises the following steps.
[0006] Obtaining a target detection license plate image;
[0007] According to the brightness and color of the image, the target detection license plate image is regionally segmented;
[0008] If the number of regions after regional segmentation is one, it is determined that the target detection license plate image is not a Yin and Yang license plate;
[0009] If the number of regions after regional segmentation is more than one, it is determined that the target detection license plate image is a Yin and Yang license plate;
[0010] The regions in the target detection license plate image determined as Yin and Yang license plate are subjected to brightness adjustment and color adjustment. The brightness adjustment includes adjusting different regions to the same brightness, and the color adjustment includes adjusting the color of the license plate image of all regions according to the standard color of different license plate colors calibrated under different illuminations;
[0011] The regions after the brightness adjustment and the color adjustment are superimposed to form a complete license plate image, and the Yin and Yang license plate correction is completed.
[0012] In an embodiment of the present application, before the region segmentation of the target detection license plate image, the method further comprises:
[0013] The target detection license plate image is subjected to character extraction and removal to obtain a pure color license plate image after the characters are removed.
[0014] The region segmentation of the target detection license plate image comprises:
[0015] The region segmentation of the target detection license plate image is performed according to the similarity between adjacent pixels in the pure color license plate image after the characters are removed.
[0016] In an embodiment of the present application, the character extraction of the target detection license plate image comprises:
[0017] The gray-scale image of the license plate region is obtained by performing a binarization processing on the target detection license plate image.
[0018] The license plate character edge contour is obtained according to the gray-scale image of the license plate region.
[0019] The license plate characters and the positions of the characters are obtained by scanning and detecting the horizontal direction and the vertical direction according to the pixel values.
[0020] In an embodiment of the present application, the region after the region segmentation comprises a first region and a second region, and the brightness of the first region is greater than the brightness of the second region.
[0021] When the first region is not overexposed, the brightness of the second region is enhanced with the brightness of the first region as a target brightness.
[0022] When the first region is overexposed, the color information of the target detection license plate image is obtained according to the color information of the second region, a standard color corresponding to the color information of the license plate image is taken as a target color, and the color adjustment is performed on the first region and the second region.
[0023] In an embodiment of the present application, the brightness adjustment further comprises:
[0024] The optimal brightness threshold of the license plate of different colors under different illuminations is set in advance.
[0025] The color information of the target detection license plate image is obtained.
[0026] When the brightness of the first region is less than or equal to the optimal brightness threshold, the brightness of the second region is enhanced with the brightness of the first region as a target brightness.
[0027] When the brightness of the first region is greater than the optimal brightness threshold, the optimal brightness threshold corresponding to the color information of the license plate image is taken as a target brightness, and the brightness of the first region and the second region is adjusted.
[0028] In an embodiment of the present application, the color adjustment further comprises:
[0029] When the brightness of the first region is less than or equal to the optimal brightness threshold, the color of the first region is taken as a target color, and the color of the second region is adjusted.
[0030] When the brightness of the first region is greater than the optimal brightness threshold, the color information of the target detection license plate image is obtained according to the color information of the second region, and the standard color corresponding to the color information of the license plate image is taken as a target color, and the color of the first region and the second region is adjusted.
[0031] In an embodiment of the present application, the target detection license plate image is subjected to region segmentation, and the method further comprises:
[0032] The gray value of each pixel point of the target detection license plate image is obtained.
[0033] The pixel points meeting the preset gray threshold range are connected to form a closed region.
[0034] After the region segmentation, the method further comprises:
[0035] If the closed region is consistent with the target detection license plate image, it is determined that the target detection license plate image is a non-yin-yang license plate.
[0036] If the closed region is not consistent with the target detection license plate image, it is determined that the target detection license plate image is a yin-yang license plate, and the boundary line of the image segmentation is obtained.
[0037] In an embodiment of the present application, the regions subjected to the brightness adjustment and the color adjustment are subjected to image superposition according to the boundary line of the image segmentation, and the removed characters are added according to the coordinate positions to combine a complete license plate image.
[0038] The present application also provides a yin-yang license plate correction system, comprising:
[0039] An image acquisition module is configured to obtain a target detection license plate image.
[0040] A region segmentation module is configured to segment the target detection license plate image according to the brightness and color of the image.
[0041] A judgment module is configured to judge the target detection license plate image.
[0042] If the number of regions after region segmentation is one, it is determined that the target detection license plate image is a non-yin-yang license plate;
[0043] If the number of regions after region segmentation is more than one, it is determined that the target detection license plate image is a yin-yang license plate;
[0044] An image correction module is configured to perform brightness adjustment and color adjustment on the regions in the target detection license plate image determined as a yin-yang license plate; the brightness adjustment includes adjusting different regions to the same brightness, and the color adjustment includes adjusting the color of the license plate image of all regions according to the standard color calibrated under different illuminations for different license plate colors in advance;
[0045] An image combination module is configured to perform image superposition on the regions after brightness adjustment and color adjustment, and combine the regions into a complete license plate image to complete yin-yang license plate correction.
[0046] The application further provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method in any of the above.
[0047] The application further provides an electronic terminal, comprising a processor and a memory.
[0048] The memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory to enable the terminal to perform the method in any of the above.
[0049] The yin-yang license plate correction method and system in the application can automatically analyze whether the current captured license plate image is a yin-yang license plate, and if it is a yin-yang license plate, the target license plate brightness and color are judged according to the brightness and color information of the two regions of the yin-yang license plate, respectively, the license plates obtained after correction are combined together to ensure the consistency of the license plate color and brightness, and the accuracy of license plate attribute recognition can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 is a flowchart of the yin-yang license plate correction method in the embodiment of the application.
[0051] Figure 2 is a schematic diagram of a yin-yang license plate in the yin-yang license plate correction method in the embodiment of the application.
[0052] Figure 3 is a schematic diagram of the effect of a yin-yang license plate after correction in the yin-yang license plate correction method in the embodiment of the application.
[0053] Figure 4 is a structural schematic diagram of a yin-yang license plate correction system in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The present application is described and explained more fully with reference to the following detailed description. Other advantages of the present application will be more fully appreciated by reference to the following detailed description.
[0055] It should be noted that the drawings provided in the following embodiments are only schematic and are intended to provide the basic understanding of the present application. In the drawings, the shape, the number and the size of components are not intended to represent the actual shape, the number and the size of the components in the present application, and the actual shape, the number and the size of the components can be changed arbitrarily, and the layout of the components can be more complex.
[0056] In the following description, a large number of details are discussed to provide a more thorough explanation of embodiments of the present application, however, it is apparent to those skilled in the art that the embodiments of the present application can be implemented without these specific details, and in other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in the form of details, to avoid making the embodiments of the present application difficult to understand.
[0057] As shown in Figure 1 the yin-yang license plate correction method in the present embodiment includes:
[0058] S101. Obtain a target detection license plate image;
[0059] S102. Perform region segmentation on the target detection license plate image according to the brightness and color of the image;
[0060] S103. If the number of regions after region segmentation is one, determine that the target detection license plate image is a non-yin-yang license plate;
[0061] S104. If the number of regions after region segmentation is greater than one, determine that the target detection license plate image is a yin-yang license plate;
[0062] S105. Perform brightness adjustment and color adjustment on the regions in the target detection license plate image determined to be a yin-yang license plate; the brightness adjustment includes adjusting different regions to the same brightness, and the color adjustment includes adjusting the color of the license plate image of all regions according to the standard color calibrated in advance for different license plate colors under different illuminations;
[0063] S106. The regions after brightness adjustment and color adjustment are superimposed to form a complete license plate image, and the positive-negative license plate correction is completed.
[0064] In step S101 in the embodiment, first, a target detection license plate image is acquired. The image acquisition mode can be real-time acquisition, for example, a license plate sub-image obtained by a lens camera snapshot system. The license plate sub-image in the embodiment can be an image obtained after process processing. When the license plate image is blocked by a building or other objects to form a positive-negative license plate, the overall image will have two parts with different brightness and color, i.e., a positive-negative license plate.
[0065] In an embodiment, in order to exclude the effect of characters such as license plate numbers on the license plate color correction process, the license plate characters are first extracted before image segmentation. The target detection license plate image is subjected to character extraction and removal, and a pure color license plate image after character removal is obtained. Optionally, in the embodiment, the gray-scale image of the license plate region is obtained by adaptive binarization processing of the license plate region, and the Canny edge detection algorithm can be used to obtain the edge contour of the license plate characters, and the characters in the license plate region are extracted and segmented. In the embodiment, the horizontal direction and the vertical direction are scanned and detected by using the pixel value judgment method, and the corresponding license plate characters and the positions of the characters are finally obtained. Then, the license plate characters of the original image are removed, and a pure background license plate is obtained, which facilitates color correction of the license plate region.
[0066] In step S102 in the embodiment, the target detection license plate image is subjected to region segmentation according to the brightness and color of the license plate image. In general, when a building or other objects block light to form a positive-negative license plate, the overall license plate image will have two parts with different brightness and color, and the license plate image will be segmented into different regions, as shown in FIG. 2. Figure 2 If the license plate image is not a positive-negative license plate, the brightness and color of the entire region of the license plate image can remain consistent. Optionally, the target detection license plate image can be subjected to region segmentation according to the similarity between adjacent pixels in the pure color license plate image after character removal.
[0067] In the embodiment, the gray value of each pixel point of the target detection license plate image is acquired; each pixel point meeting a preset gray threshold range is connected to form a closed region; if the closed region is consistent with the target detection license plate image, it is determined that the target detection license plate image is a non-yin-yang license plate; if the closed region is not consistent with the target detection license plate image, it is determined that the target detection license plate image is a yin-yang license plate, and the boundary line of image segmentation is acquired. In the embodiment, the similarity between pixel points is taken as a detection basis, the pixel points close in spatial position and close in gray value are connected to each other to form a closed region, and the boundary line of image segmentation is obtained at the same time. Meanwhile, the method can accurately obtain the boundary line of a regular or irregular region, ensures the accuracy of subsequent combination and superposition after correction, and has strong adaptability. After image segmentation, the yin-yang license plate can be segmented into two regions, and it is indicated that the current license plate is a yin-yang license plate when the license plate region after segmentation is equal to two. Those skilled in the art should know that the image segmentation of the license plate can also use other methods, and the ultimate goal is to determine whether the current license plate image is a yin-yang license plate through the license plate region after segmentation, and obtain the boundary line of the yin-yang region. If the current license plate is determined to be a yin-yang license plate, subsequent operation is performed, and if the license plate is not a yin-yang license plate, the subsequent license plate correction process is directly not performed.
[0068] In step S105 of the embodiment, the region in the target detection license plate image determined to be a yin-yang license plate is subjected to brightness adjustment and color adjustment; wherein the brightness adjustment includes adjusting different regions to the same brightness, and the color adjustment includes adjusting the color of the license plate image of all regions according to the standard color of different license plate colors calibrated under different illuminations. In the embodiment, the region after segmentation includes two different regions, i.e., a first region and a second region, wherein the first region is a bright region, i.e., a non-shaded region, and the second region is a dark region, i.e., a shaded region. In the embodiment, when the brightness of the non-shaded region does not meet the correction requirement, a standard license plate template can be taken as a target, and when the brightness of the non-shaded region meets the correction requirement, the brightness of the non-shaded region can be taken as a final correction target.
[0069] In an embodiment, the brightness of the license plate is first corrected. If the brightness is overexposed, the effect of the correction of the color of the license plate will be affected. When the license plate is too bright, the color will be over-saturated. Specifically, when the first region is not overexposed, the brightness of the first region is taken as the target brightness, and the brightness of the second region is enhanced. When the first region is overexposed, the color information of the target detection license plate image is obtained according to the color information of the second region, the standard color corresponding to the color information of the license plate image is taken as the target color, and the color of the first region and the second region is adjusted. For brightness, there are two different regions of light and dark in the license plate image. In actual work, it is usually better to have a relatively bright image, so in the case of no overexposure in the light region, the brightness of the brighter region is taken as the target, and the brightness of the dark region is corrected to be consistent with the light region. If the license plate in the light region is overexposed, according to the observation of the license plate under different illuminations, when the brightness of the license plate is overexposed, the color will be over-saturated, the color will be lost, and the overall license plate will be white, which will make it difficult to distinguish the essential color of the license plate. Therefore, if the license plate in the light region is overexposed, the color information of the current license plate is determined according to the color information of the dark region, for example, common license plate colors: blue, yellow, green, etc., and clear license plate color information is provided for the next color correction.
[0070] In the present embodiment, the optimal brightness threshold is set in advance; when the brightness of the first region is less than or equal to the optimal brightness threshold, the color of the first region is taken as the target color, and the color of the second region is adjusted; when the brightness of the first region is greater than the optimal brightness threshold, the color information of the target detection license plate image is obtained according to the color information of the second region, and the standard color corresponding to the color information of the license plate image is taken as the target color, and the color of the first region and the second region is adjusted. In the present embodiment, the brightness threshold YMaxThr of the license plate in the light region is calibrated in advance, and the threshold YMaxThr is the optimal value of the brightness of the license plate obtained by testing under different illumination conditions. When the brightness of the license plate is greater than the threshold YMaxThr, it indicates that the color of the license plate is lost, and if the brightness of the license plate in the dark region is corrected to this brightness, the overall brightness of the license plate will not be the best. Therefore, in the present embodiment, the brightness threshold of the license plate of different colors can be calibrated in advance according to the brightness effect under different illuminations. Therefore, when the brightness of the light region is greater than the threshold YMaxThr, the brightness of the license plate in the light region and the brightness of the license plate in the dark region are corrected at the same time, and the target brightness of the correction is the optimal brightness obtained by the license plate under different illuminations in advance. It can be obtained by the current license plate brightness Y' and the target brightness Y that needs to be corrected:
[0071] Y=Y'*YRatio
[0072] Wherein, YRatio is the correction coefficient obtained.
[0073] In the embodiment, the color of the bright area image before brightness correction is analyzed. If the brightness of the bright area is overexposed, the color of the dark area is analyzed to determine the color information of the current license plate. If the brightness of the bright area does not exceed the optimal brightness threshold, the color of the dark area is corrected with the color of the bright area as the target color. If the brightness of the bright area exceeds the optimal brightness threshold, the color of the bright area is not the optimal target color, and the color of the bright area and the dark area of the license plate needs to be corrected respectively. Therefore, the final effect of different license plates under different illuminations is different. The optimal color of the license plate is calibrated under different illuminations, and the adjustment coefficient calculated according to the current license plate color and the target license plate color is:
[0074] U=U'*URatio
[0075] V=V'*VRatio
[0076] Wherein, U, V are converted colorimetric, U', V' are converted colorimetric. URatio, VRatio is the conversion coefficient.
[0077] In the embodiment, the regions after brightness adjustment and color adjustment are superimposed according to the boundary line of image segmentation, and the characters removed before are added according to the coordinate position to combine into a complete license plate image. The embodiment superimposes the color corrected regions first, and then re-superimposes and combines the two parts of the license plate after brightness correction and color correction to combine into a complete license plate, so that the entire license plate remains consistent in color and brightness. When judging the positive and negative license plates, the segmentation line of the regular and irregular license plates can be obtained, and the two parts of the region can be completely combined together according to the previous segmentation line during superimposition. Finally, the characters segmented before are superimposed into the corrected license plate region according to the coordinate position, as shown in Figure 3 .
[0078] Correspondingly, the embodiment also provides a positive and negative license plate correction system, comprising:
[0079] An image acquisition module is configured to acquire a target detection license plate image.
[0080] A region segmentation module is configured to segment the target detection license plate image according to the brightness and color of the image.
[0081] A judgment module is configured to judge the target detection license plate image.
[0082] If the number of regions after region segmentation is one, it is determined that the target detection license plate image is a non-positive and negative license plate.
[0083] If the number of regions after region segmentation is more than one, it is determined that the target detection license plate image is a positive and negative license plate.
[0084] a brightness correction module configured to perform brightness adjustment on the regions in the target detected license plate image determined as the positive-negative license plate, the brightness adjustment including adjusting different regions to the same brightness;
[0085] a color correction module configured to perform color adjustment on the regions in the target detected license plate image determined as the positive-negative license plate, the color adjustment including adjusting the color of all regions of the license plate image according to the standard color calibrated under different illuminations for different license plate colors preset;
[0086] an image combination module configured to perform image superposition on the regions after the brightness adjustment and the color adjustment, and combine the regions into a complete license plate image to complete the positive-negative license plate correction.
[0087] In the embodiment, the judging module can analyze whether the current license plate is a positive-negative license plate according to the license plate image captured by the camera, and when it is determined that the license plate is a positive-negative license plate, subsequent positive-negative license plate correction operation is performed. First, the license plate characters in the license plate are obtained, and after the license plate characters are removed, the positive-negative license plate is determined for the pure background color license plate and the corresponding positive-negative region boundary line is obtained. The region segmentation module can segment the current positive-negative license plate to obtain two regions with different brightness and color. The brightness correction module and the color correction module can analyze the color and brightness of the two regions respectively to obtain the target color and brightness to be corrected. The brightness correction coefficient and the color correction coefficient are calculated according to the license plate color and brightness. The combination module can recombine the corrected license plate according to the segmented regions into a complete license plate to ensure the overall license plate color and brightness consistency. The positive-negative license plate correction system in the embodiment can perform image superposition on the regions after the brightness adjustment and the color adjustment to combine the regions into a complete license plate image to complete the positive-negative license plate correction by using the method in the method embodiment.
[0088] The embodiment also provides a computer readable storage medium having a computer program stored thereon, the program being executed by a processor to implement any one of the methods in the embodiment.
[0089] The embodiment also provides an electronic terminal, including a processor and a memory.
[0090] The memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory to enable the terminal to perform any one of the methods in the embodiment.
[0091] Those skilled in the art can understand that all or part of the steps of the foregoing method embodiments can be completed by using a computer program related hardware. The foregoing computer program can be stored in a computer readable storage medium. The program performs steps including the foregoing method embodiments when executed; and the foregoing storage medium includes ROM, RAM, magnetic disk or optical disk and various storage media that can store program codes.
[0092] The electronic terminal provided in the embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected with the processor and the transceiver and complete communication between each other. The memory is used for storing a computer program. The communication interface is used for communication. The processor and the transceiver are used for running the computer program, so that the electronic terminal executes each step of the method.
[0093] In the embodiment, the memory can include a random access memory (RAM) and can also include a non-volatile memory, for example, at least one disk memory.
[0094] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP) and the like; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0095] In the foregoing embodiments, unless otherwise specified, the common objects are described by using the ordinal numbers “first”, “second” and the like, which only represent different instances of the same object, rather than indicating that the described objects must be in a given order, whether in time, space, sequence or any other manner.
[0096] In the foregoing embodiments, the description of the specification refers to “the embodiment”, “one embodiment”, “another embodiment” or “other embodiments” means that the specific features, structures or characteristics described in connection with the embodiment are included in at least some embodiments, but not necessarily all embodiments. The multiple occurrences of “the embodiment”, “one embodiment”, “another embodiment” do not necessarily refer to the same embodiment.
[0097] While the present application has been described in connection with specific embodiments thereof, it will be understood that many modifications, variations and alternatives will be apparent to those skilled in the art as a result of the foregoing disclosure. For example, other memory structures (e.g., dynamic RAM (DRAM)) can use the embodiments discussed. It is intended to embrace all such alternatives, modifications and variations that fall within the scope of the appended claims.
[0098] Each embodiment in the specification is described in progressive manner, and the same or similar parts between embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the system embodiment is described simply because it is basically similar to the method embodiment, and the relevant part can be referred to the part of the method embodiment.
[0099] The present application can be applied in many general or special computing system environments or configurations. For example: personal computer, server computer, handheld or portable device, tablet device, multiprocessor system, microprocessor-based system, set top box, programmable consumer electronics, network PC, minicomputer, mainframe computer, distributed computing environment including any of the above systems or devices, etc.
[0100] The present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.
[0101] The above embodiments are only illustrative of the principles and effects of the present application, and are not intended to limit the present application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical thought of the present application should be covered by the claims of the present application.
Claims
1. A method for correcting a positive and negative license plate, characterized in that: include: Get the target detection license plate image; Performing regional segmentation on the target detection license plate image according to the brightness and color of the image; If the number of regions after region segmentation is one, it is determined that the target detected license plate image is a non-yin-yang license plate; If the number of regions after region segmentation is greater than one, determining that the target detected license plate image is a yin-yang license plate; Performing brightness and color adjustments on the areas of the target detected license plate image determined to be positive or negative license plates; the brightness adjustment includes adjusting different areas to the same brightness, and the color adjustment includes adjusting the colors of the license plate images of all areas according to pre-set standard colors calibrated for different license plate colors under different lighting conditions; The areas that have undergone brightness and color adjustments are superimposed to form a complete license plate image, completing the correction of the positive and negative license plate. Before performing regional segmentation on the target detection license plate image, the method further includes: extracting and removing characters from the target detection license plate image to obtain a pure color license plate image after the characters are removed; performing regional segmentation on the target detection license plate image includes: performing regional segmentation on the target detection license plate image based on the similarity between adjacent pixels in the pure color license plate image after the characters are removed; If the segmented region includes a first region and a second region, and the brightness of the first region is greater than the brightness of the second region, the brightness adjustment includes: when the first region is not overexposed, using the brightness of the first region as a target brightness and enhancing the brightness of the second region; when the first region is overexposed, obtaining color information of the target detected license plate image based on the color information of the second region, using a standard color corresponding to the color information of the license plate image as a target color, and simultaneously performing color adjustment on the first and second regions; The brightness adjustment also includes: pre-setting optimal brightness thresholds for different color license plates under different lighting conditions; obtaining color information of the target detected license plate image; when the brightness of the first area is less than or equal to the optimal brightness threshold, using the brightness of the first area as the target brightness and enhancing the brightness of the second area; when the brightness of the first area is greater than the optimal brightness threshold, using the optimal brightness threshold corresponding to the color information of the license plate image as the target brightness and adjusting the brightness of the first area and the second area at the same time.
2. The method for correcting a positive and negative license plate according to claim 1, characterized in that: Character extraction is performed on the target detected license plate image, comprising: Obtaining a grayscale image of the license plate area by performing binarization processing on the target detection license plate image; Obtaining the edge contour of the license plate characters according to the grayscale image of the license plate area; Scan the horizontal and vertical directions according to the pixel values to obtain the license plate characters and the positions of the characters.
3. The method for correcting a positive and negative license plate according to claim 1, characterized in that: The color adjustment also includes: When the brightness of the first area is less than or equal to the optimal brightness threshold, adjusting the color of the second area using the color of the first area as the target color; When the brightness of the first area is greater than the optimal brightness threshold, the color information of the target detection license plate image is obtained according to the color information of the second area, and the standard color corresponding to the color information of the license plate image is used as the target color, and the colors of the first area and the second area are adjusted at the same time.
4. The method for correcting a positive and negative license plate according to claim 1, characterized in that: The target detection license plate image is subjected to region segmentation, further comprising: Get the grayscale value of each pixel of the target detection license plate image; Connect the pixels that meet the preset grayscale threshold range to form a closed area; After region segmentation, it also includes: If the closed area is consistent with the target detection license plate image, then the target detection license plate image is determined to be a non-yin-yang license plate; If the closed area is inconsistent with the target detection license plate image, the target detection license plate image is determined to be a yin-yang license plate, and a boundary line of image segmentation is obtained.
5. The method for correcting a positive and negative license plate according to claim 4, characterized in that: According to the boundary lines of the image segmentation, the areas after brightness adjustment and color adjustment are superimposed, and the removed characters are added according to the coordinate positions to form a complete license plate image.
6. A Yin-Yang license plate correction system, characterized in that: include: Image acquisition module, used to obtain target detection license plate image; A region segmentation module is used to perform region segmentation on the target detection license plate image according to the brightness and color of the image; The judgment module is used to judge the target detection license plate image. If the number of regions after region segmentation is one, it is determined that the target detected license plate image is a non-yin-yang license plate; If the number of regions after region segmentation is greater than one, determining that the target detected license plate image is a yin-yang license plate; A brightness correction module is used to adjust the brightness of the area in the target detection license plate image determined to be a positive license plate, wherein the brightness adjustment includes adjusting different areas to the same brightness; A color correction module is used to perform color adjustment on the area in the target detection license plate image determined to be a positive license plate. The color adjustment includes adjusting the color of the license plate image in all areas according to the pre-set standard colors calibrated for different license plate colors under different lighting conditions; The image combination module is used to superimpose the areas that have undergone brightness and color adjustment to form a complete license plate image and complete the correction of the positive and negative license plate; Before performing regional segmentation on the target detection license plate image, the method further includes: extracting and removing characters from the target detection license plate image to obtain a pure color license plate image after the characters are removed; performing regional segmentation on the target detection license plate image includes: performing regional segmentation on the target detection license plate image based on the similarity between adjacent pixels in the pure color license plate image after the characters are removed; If the segmented region includes a first region and a second region, and the brightness of the first region is greater than the brightness of the second region, the brightness adjustment includes: when the first region is not overexposed, using the brightness of the first region as a target brightness and enhancing the brightness of the second region; when the first region is overexposed, obtaining color information of the target detected license plate image based on the color information of the second region, using a standard color corresponding to the color information of the license plate image as a target color, and simultaneously performing color adjustment on the first and second regions; The brightness adjustment also includes: pre-setting optimal brightness thresholds for different color license plates under different lighting conditions; obtaining color information of the target detected license plate image; when the brightness of the first area is less than or equal to the optimal brightness threshold, using the brightness of the first area as the target brightness and enhancing the brightness of the second area; when the brightness of the first area is greater than the optimal brightness threshold, using the optimal brightness threshold corresponding to the color information of the license plate image as the target brightness and adjusting the brightness of the first area and the second area at the same time.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
8. An electronic terminal, characterized in that: include: processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal performs the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Number plate image preprocessing method
CN102509095A
HSV-based vehicle license plate shadow detection and removal method
CN107292898A
Image processing unit, image processing method, and stand-type scanner
JP2014045396A