Image processing method and device

By analyzing and processing the reflection components of the image, generating a target reflection chromaticity map and suppressing reflection, the image distortion problem caused by reflection halos is solved, and accurate identification of target objects is achieved, especially the identification of truck LED lights and license plates.

CN120808326APending Publication Date: 2025-10-17ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510920634.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the prior art, due to the strong halo caused by reflected light, ambient light and the LED light itself, it is difficult to accurately identify whether a truck is equipped with LED lights and recognize the license plate at night or in complex environments.

Method used

By acquiring the original image of the target object, analyzing and calculating the reflection component of each pixel, a target reflection chromaticity map is generated. This map is then used for reflection suppression processing to reduce the influence of reflection halos and restore the true color and details of the target object.

Benefits of technology

It effectively improves image quality, avoids image distortion caused by strong halos, and achieves accurate recognition of target objects, especially for truck LED lights and license plates at night or in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808326A_ABST
    Figure CN120808326A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and a device for processing an image. The method comprises the following steps: acquiring an original image obtained by shooting a target object; performing reflection component operation on three primary colors of each pixel point of the original image to obtain a reflection component of each pixel point, the three primary colors being pixel values of the pixel points on three primary color channels; determining a target reflection chromaticity diagram of the original image according to the reflection component; and performing reflection suppression processing on the original image through the target reflection chromaticity diagram to obtain a target image so as to identify a target object through the target image. Through the method and the device, the problem that the target object is difficult to recognize due to reflection in related technologies is solved, and the effect of accurately recognizing the target object is further achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer, in particular to a method and device for processing image. BACKGROUND

[0002] With the rapid development of science and technology, motor vehicles bring convenience to people's life, but also cause a series of safety problems, for example, truck with LED (Light Emitting Diode) light, which has become an important problem in the process of night road traffic.

[0003] However, the reflected light, ambient light and LED light itself can cause strong halos, especially in complex environments such as night or rainy days, so that the collected image cannot accurately identify whether the truck is equipped with LED light, and cannot identify the license plate.

[0004] In view of the above problems, there is no effective solution at present. SUMMARY

[0005] Embodiments of the present application provide a method and device for processing image, to at least solve the problem that the target object is difficult to identify due to reflection in related technologies.

[0006] According to an embodiment of the present application, a method for processing image is provided, comprising: obtaining an original image obtained by shooting a target object; performing reflection component operation on three primary colors of each pixel point of the original image to obtain reflection components of each pixel point, wherein the three primary colors are pixel values of the pixel point on three primary color channels; determining a target reflection chroma map of the original image according to the reflection components; performing reflection suppression processing on the original image through the target reflection chroma map to obtain a target image, so as to identify the target object through the target image.

[0007] In one exemplary embodiment, determining a target reflection chroma map of the original image according to the reflection components comprises: determining reflection values of each pixel point according to the three primary colors and the reflection components to obtain the target reflection chroma map.

[0008] In one exemplary embodiment, determining reflection values of each pixel point according to the three primary colors and the reflection components comprises: determining a first parameter value according to the reflection components of the i-th pixel point, wherein the original image comprises the i-th pixel point, and i is an integer; determining the reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point.

[0009] In an example embodiment, determining the first parameter value according to the reflection component of the i-th pixel point comprises: determining a reflection component with the maximum value in the reflection components of the i-th pixel point as a target reflection component; performing summation processing on the reflection components of the i-th pixel point to obtain a first sum value; and determining the ratio of the target reflection component to the first sum value as the first parameter value.

[0010] In an example embodiment, determining the reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point comprises: determining a value with the maximum value in the three primary colors of the i-th pixel point as a target primary color; determining the average of the three primary colors of the i-th pixel point as an average primary color; and determining the reflection value of the i-th pixel point according to the target primary color, the average primary color, the first parameter value, and the three primary colors.

[0011] In an example embodiment, determining the reflection value of the i-th pixel point according to the target primary color, the average primary color, the first parameter value, and the three primary colors comprises: performing summation processing on the three primary colors to obtain a second sum value; determining the product of the second sum value and the first parameter value as a first product; determining the difference between the first product and the average primary color as a second parameter value; determining the product of the first coefficient and the first parameter value as a second product; determining the difference between the second product and the first value as a third parameter value; determining the ratio of the second parameter value to the third parameter value as a first ratio; and determining the difference between the target primary color and the first ratio as the reflection value of the i-th pixel point.

[0012] In an example embodiment, performing reflection suppression processing on the original image by using the target reflectance chromaticity diagram to obtain a target image comprises: determining a restored image of the original image according to the pixel values and the reflection values of the respective pixel points; and performing halo suppression processing on the respective pixel points of the restored image to obtain the target image.

[0013] In an example embodiment, performing halo suppression processing on the respective pixel points of the restored image to obtain the target image comprises: obtaining an atmospheric light value and an ambient light value of a j-th pixel point, wherein the restored image comprises the j-th pixel point, and j is an integer; determining the transmittance of the j-th pixel point according to the pixel value and the ambient light value of the j-th pixel point; and determining a target pixel value of the j-th pixel point according to the pixel value, the atmospheric light value, the ambient light value, and the transmittance of the j-th pixel point, wherein the target pixel value is the pixel value of the j-th pixel point in the target image.

[0014] In an example embodiment, determining the transmittance of the j-th pixel point according to the pixel value and the ambient light value of the j-th pixel point comprises: determining the ratio of the ambient light value to the pixel value of the j-th pixel point as a second ratio; and determining the product of the second ratio and the second coefficient as the transmittance of the j-th pixel point.

[0015] In one example embodiment, the target pixel value of the jth pixel point is determined according to the pixel value of the jth pixel point, the atmospheric light value, the ambient light value and the transmittance, including: determining the sum of the ambient light value and the atmospheric light value as a fourth parameter value; determining the difference between the second value and the transmittance as a first difference value; determining the product of the fourth parameter value and the first difference value as a third product; determining the difference between the pixel value of the jth pixel point and the third product as a second difference value; determining the ratio of the second difference value and the transmittance as a first pixel value; determining the difference between the first pixel value and the fourth parameter value as a second pixel value; wherein the target pixel value of the jth pixel point is the first pixel value or the second pixel value.

[0016] According to another embodiment of the present application, there is provided an apparatus for processing an image, including: an obtaining module configured to obtain an original image taken of a target object; an operating module configured to perform a reflection component operation on three primary colors of each pixel point of the original image to obtain a reflection component of each pixel point, wherein the three primary colors are pixel values of the pixel point on three primary color channels; a determining module configured to determine a target reflection chroma map of the original image according to the reflection component; and a processing module configured to perform reflection suppression processing on the original image through the target reflection chroma map to obtain a target image, so that the target object is identified through the target image.

[0017] According to yet another embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0018] According to yet another embodiment of the present application, there is also provided an electronic device including a memory and a processor, the memory having a computer program stored therein, and the processor being configured to execute the computer program to perform the steps of any of the above method embodiments.

[0019] According to yet another embodiment of the present application, there is also provided a computer program product including a computer program, the computer program, when executed by a processor, implementing the steps of the method described in any of the above embodiments.

[0020] According to the present application, the original image containing a target object is analyzed and processed, the reflection component of each pixel point on three primary color channels in the original image is obtained, the target reflection chroma map of the original image is determined according to the reflection component, and then the reflection suppression processing is performed on the original image through the target reflection chroma map to obtain a target image, so that the target object is identified through the target image.

[0021] Due to the analysis and processing of color data of the image, the target reflection chromaticity diagram of the original image is determined, so that the light intensity part caused by the object surface reflection or other mirror reflection is estimated and separated through the target reflection chromaticity diagram, the image quality is effectively improved, the image distortion caused by the strong light halo phenomenon due to reflection is avoided, and more accurate support is provided for subsequent image processing and analysis. The problem that the target object is difficult to identify due to reflection in the related art can be solved, and the effect of accurately identifying the target object is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a hardware structure block diagram of a mobile terminal according to the method for processing an image according to the embodiment of the present application;

[0023] Figure 2 is a flow chart of the method for processing an image according to the embodiment of the present application;

[0024] Figure 3 is a flow chart of the method for identifying the LED lamp according to the embodiment of the present application;

[0025] Figure 4 is a line drawing configuration schematic diagram according to the embodiment of the present application;

[0026] Figure 5 is a target detection schematic diagram according to the embodiment of the present application;

[0027] Figure 6 is a 80LX lamp shooting example diagram according to the embodiment of the present application;

[0028] Figure 7 is an image enhancement flow chart according to the embodiment of the present application;

[0029] Figure 8 is a basic framework example diagram of the light source composition according to the embodiment of the present application;

[0030] Figure 9 is an example diagram of the image enhancement according to the embodiment of the present application;

[0031] Figure 10 is a structure block diagram of the device for processing an image according to the embodiment of the present application. DETAILED DESCRIPTION

[0032] Hereinafter, the embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

[0033] It should be noted that the terms 'first','second', and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.

[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG is a hardware structure block diagram of a mobile terminal according to a method for processing an image according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0035] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the image processing method in the embodiments of the present invention. The processor 102 executes the computer programs stored in the memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and such remote memory may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0037] In this embodiment, a method for processing an image running on the mobile terminal is provided. Figure 2 is a flowchart of a method for processing an image according to an embodiment of the present invention. Figure 2As shown, the flow includes the following steps:

[0038] In step S202, an original image of a target object is acquired.

[0039] The target object can be a specific object or scene that needs to be detected, recognized or analyzed, such as a truck, a passenger car, etc. The original image can be an image collected by an image collection device without any processing. The original image can be an image collected in a preset environment, such as an environment with a 80LX flash light or an environment with a 10000LX xenon light.

[0040] The original image of the target object collected by the image collection device in the preset environment is acquired.

[0041] In step S204, a reflection component operation is performed on the three primary colors of each pixel point of the original image to obtain the reflection component of each pixel point, wherein the three primary colors are pixel values of the pixel point in three primary color channels.

[0042] The pixel point can be a basic unit of a digital image. In the image processing process, the image can be regarded as a grid composed of many small squares (pixels), each pixel contains color information, which is used to display a part of the image. The number and size of the pixel points determine the resolution of the image. The higher the resolution, the more details the image has.

[0043] The three primary colors can be pixel values of each pixel point in three primary color channels (i.e. red, green and blue channels), such as L r (x), L g (x), L b (x), x represents a pixel point. For a digital image, each pixel point has a corresponding value in red, green and blue channels. The combination of the three values determines the color (i.e. pixel value) displayed by the pixel point. The reflection component can be color and brightness information formed by light reflection or other mirror reflection of the object surface in the image. Each pixel point has a corresponding reflection component in three primary color channels, such as R r (x), R g (x), R b (x), x represents a pixel point.

[0044] After acquiring the original image, the three primary colors of each pixel point of the original image are processed and analyzed, including performing a reflection component operation on the three primary colors, such as performing a second-order Laplacian filter operation on the pixel value of each channel of the pixel point, to obtain the reflection component of each pixel point. The reflection component includes the reflection component of each pixel point in three primary color channels.

[0045] Step S206, determining a target reflectance chrominance map of the original image according to the reflection component;

[0046] The target reflectance chrominance map can be an image for reflectance suppression of the original image and estimation of a real color of the target object, and can be calculated according to the reflection component. Through the target reflectance chrominance map, the influence of reflection on the target object can be stripped, and the inherent chrominance of the surface of the target object can be restored.

[0047] Optionally, determining the target reflectance chrominance map of the original image according to the reflection component comprises: determining a reflection value of each pixel point according to the three primary colors and the reflection component to obtain the target reflectance chrominance map.

[0048] The reflection value can be a pixel value of each pixel point in the target reflectance chrominance map.

[0049] The reflection chrominance map is generated by the pixel value of the pixel point on the three primary color channels and the reflection component, which can better capture and describe the light reflection characteristics of the object surface, so that the inherent color of the target object itself and the influence of the light can be better separated in the subsequent reflectance suppression process, and the accuracy and detail performance of color restoration are improved.

[0050] Step S208, performing reflectance suppression processing on the original image through the target reflectance chrominance map to obtain a target image, so as to identify the target object through the target image.

[0051] Optionally, the execution subject of the above steps can be a background processor, or other devices with similar processing capabilities, and can also be a machine at least integrated with an image acquisition device and a data processing device, wherein the image acquisition device can include a camera and other image acquisition modules, and the data processing device can include a computer, a mobile phone and other terminals, but is not limited thereto.

[0052] Through the above steps, the original image containing the target object is analyzed and processed, the reflection component of each pixel point in the original image on the three primary color channels is obtained, the target reflectance chrominance map of the original image is determined according to the reflection component, and then the original image is processed by reflectance suppression through the target reflectance chrominance map to obtain a target image, so that the target object is identified through the target image. Since the color data of the image is analyzed and processed, the target reflectance chrominance map of the original image is determined, and the light intensity part caused by the reflection or other specular reflection of the object surface is estimated and separated through the target reflectance chrominance map, so that the image quality is effectively improved, the image distortion caused by the strong light halo phenomenon due to reflection is avoided, and more accurate support is provided for subsequent image processing and analysis. The problem that the target object is difficult to identify due to reflection in the related art is solved, and the effect of accurately identifying the target object is achieved.

[0053] As an optional implementation, the determining of the reflection value of each pixel point according to the three primary colors and the reflection component includes: determining a first parameter value according to the reflection component of the i-th pixel point, wherein the original image includes the i-th pixel point, and i is an integer; and determining the reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point.

[0054] The i-th pixel point can be any pixel point in the original image; and the first parameter value can be a reflection coefficient of the pixel point calculated according to the reflection components of the pixel point in the three primary color channels. The reflection value of the pixel point is calculated according to the pixel value and the reflection coefficient of the pixel point in the three primary color channels, so as to determine the target reflection chroma diagram of the original image according to the reflection values of the pixel points.

[0055] Optionally, the determining of the first parameter value according to the reflection component of the i-th pixel point includes: determining a reflection component with the maximum value in the reflection components of the i-th pixel point as a target reflection component; performing summation processing on the reflection components of the i-th pixel point to obtain a first sum value; and determining the ratio of the target reflection component to the first sum value as the first parameter value.

[0056] Optionally, the first parameter value can be determined by the following formula:

[0057]

[0058] In the formula, x is the i-th pixel point; β(x) is the first parameter value of the i-th pixel point; R is a reflection component operation, that is, a second-order Laplacian filter is performed on the pixel values of the i-th pixel point in the three primary color channels; R r (x), R g (x), R b (x) is the reflection component of the i-th pixel point in the three primary color channels.

[0059] Optionally, the determining of the reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point includes: determining a value with the maximum value in the three primary colors of the i-th pixel point as a target three primary color; determining the average value of the three primary colors of the i-th pixel point as an average three primary color; and determining the reflection value of the i-th pixel point according to the target three primary color, the average three primary color, the first parameter value and the three primary colors.

[0060] As an optional implementation, the reflection value of the i-th pixel point is determined according to the target tristimulus value, the average tristimulus value, the first parameter value, and the tristimulus value, including: performing sum processing on the tristimulus value to obtain a second sum value; determining a first product as a product of the second sum value and the first parameter value; determining a second parameter value as a difference between the first product and the average tristimulus value; determining a second product as a product of the first coefficient and the first parameter value; determining a third parameter value as a difference between the second product and the first value; determining a first ratio as a ratio of the second parameter value and the third parameter value; and determining the reflection value of the i-th pixel point as a difference between the target tristimulus value and the first ratio.

[0061] For example, the reflection value of the i-th pixel point can be determined by the following formula:

[0062]

[0063] In the formula, x is the i-th pixel point; N(x) is the reflection value of the i-th pixel point; β(x) is the first parameter value of the i-th pixel point; L max (x) = max{L r (x), L g (x), L b (x) is the target tristimulus value of the i-th pixel point; L r (x), L g (x), L b (x) is the pixel value of the i-th pixel point in the tristimulus channel. (x) is the average tristimulus value of the i-th pixel point.

[0064] As an optional implementation, the reflection suppression processing is performed on the original image by the target reflection chromaticity diagram to obtain a target image, including: determining a recovered image of the original image by the pixel value and the reflection value of each pixel point; and performing halo suppression processing on each pixel point of the recovered image to obtain the target image.

[0065] The recovered image can be an image obtained by performing reflection suppression on the original image. The recovered image can reconstruct the real scene distorted due to reflection and scattering when the original image is captured, so that the real color and details in the scene are retained in the recovered image, the artifacts caused by reflected light are reduced, and more accurate support is provided for subsequent image processing and analysis.

[0066] The target image can be an image after halo suppression of the restored image. Since the light source near the target object itself can cause halo due to light scattering, the automatic image analysis system is disturbed, and therefore, after the restored image is generated, halo suppression processing is required to further improve the image quality, so as to further reduce the influence of the blurred image boundary caused by the halo, so as to accurately identify the target object.

[0067] Optionally, the pixel value of each pixel point in the restored image can be determined by the following formula:

[0068] I(x)=L(x)-N(x)

[0069] In the formula, x is the i-th pixel point; I(x) is the pixel value of the i-th pixel point in the restored image; L(x) is the pixel value of the i-th pixel point in the original image; and N(x) is the reflection value of the i-th pixel point.

[0070] As an optional embodiment, the halo suppression processing is performed on each pixel point of the restored image to obtain a target image, including: obtaining the atmospheric light value and the ambient light value of the j-th pixel point, wherein the restored image includes the j-th pixel point, and j is an integer; determining the transmittance of the j-th pixel point according to the pixel value and the ambient light value of the j-th pixel point; and determining the target pixel value of the j-th pixel point according to the pixel value, the atmospheric light value, the ambient light value and the transmittance of the j-th pixel point, wherein the target pixel value is the pixel value of the j-th pixel point in the target image.

[0071] Optionally, the atmospheric light value of each pixel point in the restored image can be determined by the dark channel image of the restored image, for example, all pixel points in a central neighborhood range of the j-th pixel point in the restored image are determined to obtain a first pixel point set, the pixel values of each pixel point in the first pixel point set in three color channels are determined to obtain a first pixel value set, and the smallest pixel value in the first pixel value set is taken as the pixel value of the j-th pixel point in the dark channel image; the pixel value of the j-th pixel point in the dark channel image is taken as the atmospheric light value of the j-th pixel point, and the pixel value of the j-th pixel point in the dark channel image can be determined by the following formula:

[0072]

[0073] In the formula, m is the j-th pixel point; I dark (m) is the pixel value of the j-th pixel point in the dark channel image; C is a channel; Ω(m) is a central neighborhood range of the j-th pixel point; I C (n) is the pixel value of any pixel point in the central neighborhood range of the j-th pixel point in the restored image in any channel of the three primary colors.

[0074] Optionally, the ambient light value of each pixel in the restored image can be determined by restoring the pixel value of each pixel in the image, for example, determining all the pixels in the central neighborhood range of the jth pixel in the restored image to obtain a first pixel set, determining the pixel value of each pixel in the first pixel set to obtain a second pixel value set, and taking the smallest pixel value in the second pixel value set as the ambient light value of the jth pixel. For example, the ambient light value of the jth pixel can be determined by the following formula:

[0075]

[0076] In the formula, m is the jth pixel; A(m) is the ambient light value of the jth pixel; I(m) is the pixel value of the jth pixel in the restored image; and Ω(m) is the central neighborhood range of the jth pixel.

[0077] As an optional implementation, the transmittance of the jth pixel is determined according to the pixel value and the ambient light value of the jth pixel, including: determining the ratio of the ambient light value to the pixel value of the jth pixel as a second ratio; and determining the product of the second ratio and a second coefficient as the transmittance of the jth pixel.

[0078] For example, the transmittance of the jth pixel can be determined by the following formula:

[0079]

[0080] In the formula, m is the jth pixel; τ(m) is the transmittance of the jth pixel; A(m) is the ambient light value of the jth pixel; I(m) is the pixel value of the jth pixel in the restored image; and α is the second coefficient, usually taking a value of 0.95.

[0081] As an optional implementation, the target pixel value of the jth pixel is determined according to the pixel value, the atmospheric light value, the ambient light value and the transmittance of the jth pixel, including: determining the sum of the ambient light value and the atmospheric light value as a fourth parameter value; determining the difference between the second value and the transmittance as a first difference; determining the product of the fourth parameter value and the first difference as a third product; determining the difference between the pixel value of the jth pixel and the third product as a second difference; determining the ratio of the second difference to the transmittance as a first pixel value; determining the difference between the first pixel value and the fourth parameter value as a second pixel value; and wherein the target pixel value of the jth pixel is the first pixel value or the second pixel value.

[0082] For example, the first pixel value can be determined by the following formula:

[0083]

[0084] In the formula, m is the jth pixel point; O(m) is the first pixel value of the jth pixel point; I(m) is the pixel value of the jth pixel point in the restored image; I ∞ (m) is the atmospheric light value of the jth pixel point; A(m) is the ambient light value of the jth pixel point; and τ(m) is the transmittance of the jth pixel point.

[0085] For example, the second pixel value can be determined by the following formula:

[0086] F(m) = O(m) - (I ∞ (m) + A(m))

[0087] In the formula, m is the jth pixel point; F(m) is the second pixel value of the jth pixel point; O(m) is the first pixel value of the jth pixel point; I ∞ (m) is the atmospheric light value of the jth pixel point; and A(m) is the ambient light value of the jth pixel point.

[0088] By performing secondary halo suppression on the restored image, the halo effect can be more effectively reduced, while details and textures in the image are retained, avoiding the loss of some details when removing the halo in the primary halo suppression, making the differences between different regions more obvious and natural, and ensuring that the colors of the image are closer to the real scene.

[0089] As an optional embodiment, taking identification of a truck with an added LED (Light Emitting Diode) as an example, Figure 3 is a flowchart for identifying an added LED lamp according to an embodiment of the present application, as Figure 3 shown, the specific flow is as follows:

[0090] S301, sending a real-time image collected by a front-end camera into an input module;

[0091] S302, configuring a lane line, a pre-grab detection line, and an LED lamp identification line by the system, as Figure 4 shown;

[0092] S303, performing target detection by using a deep learning method, the method of target detection is not limited to an anchor-base (YOLO, SSD, RCNN series, etc.) or anchor-free (CenterNet, CornerNet, etc.) method, taking centernet for target detection as an example, as Figure 5As shown, including: input the image collected by the front-end camera, get the center point Vc of the vehicle and the width Vw and height Vh of the vehicle body frame (i.e. target detection frame); through the tracking method of traditional correlation filtering (csk, kcf) or deep learning (CenterTrack, SiamRPN series, etc.), the detected vehicle center point, and the displacement feature of the last vehicle is obtained by using the inter-frame center point, the displacement direction feature of the vehicle is predicted, and it is ensured that the same vehicle is ensured in front and rear frames;

[0093] S304, determine whether the vehicle passes through the pre-grab detection line, if yes, go to the next step (i.e. S305), if not, cancel the event;

[0094] S305, when the vehicle passes through the pre-grab detection line, execute the flash of the 80LX flash light, because the flash of the 80LX flash light can preliminarily suppress strong light, so that the preliminarily suppressed image can see whether there is a large halo, then perform large halo recognition on the vehicle in the preliminarily suppressed image, if there is a large halo, preliminarily judge that the vehicle is equipped with LED light vehicle, for example Figure 6 , at this time, go to the next step (i.e. S306), otherwise cancel the event; wherein, for the recognition of the large halo, the pixel value of all pixel points in the lower half of the target detection frame can be obtained, if the number of pixel points with pixel value greater than 200 accounts for more than half of the number of all pixel points in the lower half of the target detection frame, it is determined that there is a large halo;

[0095] S306, when the vehicle preliminarily judged as equipped with LED light passes through the LED light recognition line, execute the flash of the 10000LX xenon lamp, perform image enhancement processing on the image (i.e. the original image) after flashing, the specific process is as shown in Figure 7 , including:

[0096] Figure 8 is the basic frame example diagram of the light source of the embodiment of the present application, as shown in Figure 8 , because of the existence of strong reflection light, mirror reflection and other phenomena on the road in complex weather, at the same time, the direct reflection of LED light can cause large halo, which seriously affects the accuracy of LED detection, therefore, it is necessary to suppress this part of light source.

[0097] Firstly, the intensity of the diffuse reflection and the strong reflection of the road surface is weakened, the maximum reflection chroma graph (i.e. the target reflection chroma graph) is obtained by calculating the reflection component, then the ambient light and the atmosphere light of the image after reflection suppression (i.e. the recovery image) is processed, the ambient light and the atmosphere light of the image after ambient light and atmosphere light removal (i.e. the target image determined according to the first pixel value) is obtained according to the atmospheric scattering model, finally, in order to suppress the strong light halo of the car light in the image after ambient light and atmosphere light removal, the ambient light and the atmosphere light of the image after ambient light and atmosphere light removal is weakened again, and the final recovery image (i.e. the target image determined according to the second pixel value) is obtained, after the xenon lamp above 10000LX and the image enhancement processing, the image in which the vehicle whether equipped with LED light and the license plate characters can be clearly seen is obtained, as shown in Figure 9

[0098] S307, using the trained deep learning CNN classification model to perform vehicle type recognition based on the final recovery image, the method adopts the CNN network classification method, and outputs the vehicle type as follows: mpv, suv, taxi, small truck, medium truck, large truck, small car, medium car, large car, two-wheeled vehicle, bus, sedan, skin car card, special vehicle, etc., if it is a small truck, medium truck or large truck, the vehicle type result is "truck", and the next step (i.e. S308) is entered, otherwise the event is cancelled;

[0099] S308, using the trained deep learning CNN classification model to recognize and determine whether it is an LED equipped state based on the final recovery image, if it is identified as an LED equipped state, i.e. the confidence is greater than the set threshold, the LED equipped state of the vehicle is output as "yes", and the next step (i.e. S309) is entered, otherwise the event is cancelled;

[0100] S309, license plate recognition is performed, the license plate recognition method is not limited to anchor-base (YOLO, SSD, RCNN series, etc.) or anchor-free (CenterNet, CornerNet, etc.) method; optionally, after obtaining the license plate coordinate frame, the license plate image is sent to the license plate recognition module, the license plate recognition module performs license plate color, type and license plate number recognition respectively, and outputs the license plate color (yellow, gradient green, blue, white, etc.), the license plate type and the license plate number, the license plate recognition method is not limited to traditional morphological-svm and deep learning method (RNN series, TSN, CNN, etc.).

[0101] ​Those skilled in the art can clearly understand, through the description of the foregoing embodiments, that the method according to the foregoing embodiments can be implemented by means of software on a general hardware platform as necessary, and of course can also be implemented by hardware, but in many cases the former is a better implementation. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a number of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to perform the methods described in the various embodiments of the present application.

[0102] The present application also provides a device for processing an image, which is used to implement the foregoing embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation by hardware or a combination of software and hardware is also possible and contemplated.

[0103] Figure 10 is a structural block diagram of a device for processing an image according to an embodiment of the present application, as shown in Figure 10 The device includes: an acquisition module 1002 configured to acquire an original image obtained by photographing a target object; an operation module 1004 configured to perform reflection component operation on three primary colors of each pixel point of the original image to obtain a reflection component of each pixel point, wherein the three primary colors are pixel values of the pixel point on three primary color channels; a determination module 1006 configured to determine a target reflectance chroma map of the original image according to the reflection component; and a processing module 1008 configured to perform reflection suppression processing on the original image through the target reflectance chroma map to obtain a target image, so that the target object is identified through the target image.

[0104] As an optional embodiment, the device is further configured to determine a reflection value of each pixel point according to the three primary colors and the reflection component to obtain the target reflectance chroma map.

[0105] As an optional embodiment, the device is further configured to determine a first parameter value according to the reflection component of the i th pixel point, wherein the original image includes the i th pixel point, and i is an integer; and determine the reflection value of the i th pixel point according to the first parameter value and the three primary colors of the i th pixel point.

[0106] As an optional embodiment, the device is further configured to determine a reflection component with the maximum value in the reflection component of the i th pixel point as a target reflection component; perform summation processing on the reflection component of the i th pixel point to obtain a first sum value; and determine a ratio of the target reflection component to the first sum value as the first parameter value.

[0107] As an optional implementation, the apparatus is further configured to determine a maximum value of the three primary colors of the i th pixel point as a target three primary color; determine a mean value of the three primary colors of the i th pixel point as a mean three primary color; and determine the reflectance value of the i th pixel point according to the target three primary color, the mean three primary color, the first parameter value, and the three primary colors.

[0108] As an optional implementation, the apparatus is further configured to perform sum processing on the three primary colors to obtain a second sum value; determine a product of the second sum value and the first parameter value as a first product; determine a difference between the first product and the mean three primary color as a second parameter value; determine a product of the first coefficient and the first parameter value as a second product; determine a difference between the second product and the first value as a third parameter value; determine a ratio of the second parameter value to the third parameter value as a first ratio; and determine a difference between the target three primary color and the first ratio as the reflectance value of the i th pixel point.

[0109] As an optional implementation, the apparatus is further configured to determine a restored image of the original image according to the pixel values and the reflectance values of the respective pixel points; and perform halo suppression processing on the respective pixel points of the restored image to obtain the target image.

[0110] As an optional implementation, the apparatus is further configured to obtain an atmospheric light value and an ambient light value of a j th pixel point, wherein the restored image includes the j th pixel point, and j is an integer; determine a transmittance of the j th pixel point according to a pixel value of the j th pixel point and the ambient light value; and determine a target pixel value of the j th pixel point according to the pixel value of the j th pixel point, the atmospheric light value, the ambient light value, and the transmittance, wherein the target pixel value is a pixel value of the j th pixel point in the target image.

[0111] As an optional implementation, the apparatus is further configured to determine a ratio of the ambient light value to the pixel value of the j th pixel point as a second ratio; and determine the transmittance of the j th pixel point as a product of the second ratio and a second coefficient.

[0112] As an optional implementation, the apparatus is further configured to determine a sum of the ambient light value and the atmospheric light value as a fourth parameter value; determine a difference between a second value and the transmittance as a first difference; determine a product of the fourth parameter value and the first difference as a third product; determine a second difference between the pixel value of the j th pixel point and the third product; determine a first pixel value as a ratio of the second difference to the transmittance; and determine a second pixel value as a difference between the first pixel value and the fourth parameter value, wherein the target pixel value of the j th pixel point is the first pixel value or the second pixel value.

[0113] It should be noted that the above modules can be implemented by software or hardware, and the hardware can be implemented in the following manner, but is not limited thereto: all the modules are located in the same processor; or the modules are located in different processors in any combination.

[0114] The embodiment of the present application further provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to realize the steps of the method in any one of the above embodiments.

[0115] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing a computer program.

[0116] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any one of the above method embodiments.

[0117] In an example embodiment, the electronic device can further comprise a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0118] The embodiment of the present application further provides a computer program product, comprising a computer program, wherein the computer program is executed by a processor to realize the steps of the method in any one of the embodiments of the present application.

[0119] The specific examples in the embodiment can refer to the examples described in the above embodiments and example embodiments, and the embodiment will not be described here.

[0120] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, and can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Therefore, the present application is not limited to any specific hardware and software combination.

[0121] The above merely provides the preferred embodiments of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall fall into the protective scope of the present application.

Claims

1. A method for processing an image, characterized in that: include: Obtaining an original image captured of the target object; Performing a reflection component operation on the three primary colors of each pixel of the original image to obtain a reflection component of each pixel, wherein the three primary colors are pixel values ​​of the pixel on the three primary color channels respectively; determining a target reflectance chromaticity diagram of the original image according to the reflectance component; The original image is subjected to reflection suppression processing by using the target reflection chromaticity diagram to obtain a target image, so as to identify the target object by using the target image.

2. The method according to claim 1, characterized in that Determining a target reflectance chromaticity diagram of the original image according to the reflectance component includes: The reflection value of each pixel is determined according to the three primary colors and the reflection component to obtain the target reflection chromaticity diagram.

3. The method according to claim 2, characterized in that Determining the reflection value of each pixel point according to the three primary colors and the reflection component includes: Determining a first parameter value according to the reflection component of the i-th pixel point, wherein the original image includes the i-th pixel point, and i is an integer; Determine the reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point.

4. The method according to claim 3, characterized in that Determining a first parameter value according to the reflection component of the i-th pixel point includes: Determine the reflection component with the largest value among the reflection components of the i-th pixel as the target reflection component; performing summation processing on the reflection component of the i-th pixel point to obtain a first sum value; A ratio of the target reflection component to the first sum value is determined as the first parameter value.

5. The method according to claim 3, characterized in that Determining a reflection value of the i-th pixel point according to the first parameter value and the three primary colors of the i-th pixel point includes: Determine the maximum value among the three primary colors of the i-th pixel as the target three primary colors; Determine the mean of the three primary colors of the i-th pixel as the average three primary colors; The reflection value of the i-th pixel is determined according to the target three primary colors, the average three primary colors, the first parameter value, and the three primary colors.

6. The method according to claim 5, characterized in that Determining the reflection value of the i-th pixel point according to the target three primary colors, the average three primary colors, the first parameter value, and the three primary colors includes: performing a summation process on the three primary colors to obtain a second sum value; determining a product of the second sum value and the first parameter value as a first product; taking the difference between the first product and the average three primary colors as a second parameter value; determining a product of the first coefficient and the first parameter value as a second product; taking the difference between the second product and the first value as a third parameter value; determining a ratio of the second parameter value to the third parameter value as a first ratio; The difference between the target three primary colors and the first ratio is determined as the reflection value of the i-th pixel point.

7. The method according to claim 2, characterized in that Performing reflection suppression processing on the original image using the target reflection chromaticity diagram to obtain a target image includes: Determine a restored image of the original image by using the pixel value of each pixel point and the reflection value; Performing halo suppression processing on each pixel of the restored image to obtain the target image.

8. The method according to claim 7, characterized in that Performing halo suppression processing on each pixel point of the restored image to obtain the target image includes: Obtaining the atmospheric light value and the ambient light value of the j-th pixel point, wherein the restored image includes the j-th pixel point, and j is an integer; Determining the transmittance of the j-th pixel point according to the pixel value of the j-th pixel point and the ambient light value; The target pixel value of the jth pixel point is determined according to the pixel value of the jth pixel point, the atmospheric light value, the ambient light value, and the transmittance, wherein the target pixel value is the pixel value of the jth pixel point in the target image.

9. The method according to claim 8, characterized in that Determining the transmittance of the j-th pixel point according to the pixel value of the j-th pixel point and the ambient light value, comprising: Determine a ratio of the ambient light value to the pixel value of the j-th pixel as a second ratio; The product of the second ratio and the second coefficient is determined as the transmittance of the j-th pixel point.

10. The method according to claim 8, characterized in that Determining a target pixel value of the j-th pixel point according to the pixel value of the j-th pixel point, the atmospheric light value, the ambient light value, and the transmittance includes: determining a sum of the ambient light value and the atmospheric light value as a fourth parameter value; determining a difference between the second value and the transmittance as a first difference; determining a product of the fourth parameter value and the first difference value as a third product; Determine a difference between the pixel value of the j-th pixel and the third product as a second difference; determining a ratio of the second difference to the transmittance as a first pixel value; determining a difference between the first pixel value and the fourth parameter value as a second pixel value; The target pixel value of the j-th pixel point is the first pixel value or the second pixel value.

11. A device for processing an image, characterized in that: include: An acquisition module is used to acquire an original image obtained by photographing the target object; an operation module, configured to perform a reflection component operation on the three primary colors of each pixel point of the original image to obtain a reflection component of each pixel point, wherein the three primary colors are pixel values ​​of the pixel point on the three primary color channels respectively; a determination module, configured to determine a target reflectance chromaticity diagram of the original image according to the reflectance component; A processing module is configured to perform reflection suppression processing on the original image using the target reflection chromaticity diagram to obtain a target image, so as to identify the target object through the target image.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 10 when executed by a processor.

13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.