A method, apparatus, storage medium, and electronic device for processing colored patterns on vehicle windows.
By using a trained model to process vehicle window chromatic stripe patterns, the problem of chromatic stripes affecting facial recognition in intelligent transportation checkpoints was solved, thereby improving the facial recognition rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2021-09-22
- Publication Date
- 2026-07-31
AI Technical Summary
Existing intelligent traffic checkpoint cameras capture images of vehicle windows with severe color stripes, affecting the accuracy of facial recognition and making it difficult to meet the requirements of high image quality and high facial recognition rate.
A pre-trained window stripe processing model is used to process window images containing colored stripes. The colored stripes are reduced or eliminated by machine learning techniques. The model is generated based on at least two sets of window sample image pairs, including image pairs with colored stripes and those without colored stripes.
It effectively reduces or eliminates colored stripes in the car window image, minimizing their interference with intelligent recognition functions, thereby improving the face recognition rate.
Smart Images

Figure CN115866406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, apparatus, storage medium and electronic device for processing colored patterns on vehicle windows. Background Technology
[0002] With the increasing demand for intelligent traffic checkpoint capture systems, the quality requirements for facial capture images from these cameras are also rising. However, most current images of vehicle windows exhibit severe colored stripes, significantly reducing facial recognition accuracy. This is because, for heat insulation or anti-glare purposes, a film is applied to vehicle windows. Additionally, to reduce polarized light from the windows, current capture cameras typically use a polarizing filter in front of the image sensor or lens. This combination results in severe colored stripes (or simply stripes) in the captured window images. Eliminating these stripes to meet the high image quality and high facial recognition rate requirements of intelligent traffic capture systems has become a pressing issue. Summary of the Invention
[0003] This invention provides a method, apparatus, storage medium, and electronic device for processing colored stripes in vehicle window images, which can effectively reduce or eliminate colored stripes in vehicle window images.
[0004] In a first aspect, embodiments of the present invention provide a method for processing colored patterns on vehicle windows, including:
[0005] Extract the first window image from the image to be processed; wherein, the first window image is an image containing colored stripes;
[0006] The first window image is input into a pre-trained window pattern processing model to obtain a second window image output by the model. The second window image is either an image without colored stripes, or the intensity of the colored stripes in the second window image is weaker than the intensity of the colored stripes in the first window image. The window pattern processing model is generated based on training with at least two pairs of window sample images, each pair including a first window sample image with colored stripes and a second window sample image without colored stripes corresponding to the first window sample image.
[0007] Secondly, embodiments of the present invention also provide a vehicle window texture processing device, comprising:
[0008] A vehicle window image extraction module is used to extract a first vehicle window image from an image to be processed; wherein, the first vehicle window image is an image containing colored stripes;
[0009] A window image processing module is used to input the first window image into a pre-trained window pattern processing model to obtain a second window image output by the window pattern processing model; wherein, the second window image is an image without colored stripes, or the intensity of the colored stripes in the second window image is weaker than the intensity of the colored stripes in the first window image; the window pattern processing model is generated based on training based on at least two pairs of window sample images, wherein the pair of window sample images includes a first window sample image with colored stripes and a second window sample image without colored stripes corresponding to the first window sample image.
[0010] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the window tint processing method provided in embodiments of the present invention.
[0011] Fourthly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the window tint processing method provided in the embodiments of the present invention.
[0012] This invention provides a scheme for processing colored stripes on car windows. The scheme involves extracting a first car window image from an image to be processed. The first car window image contains colored stripes. The first car window image is then input into a pre-trained colored stripe processing model to obtain a second car window image output by the model. The second car window image is either without colored stripes or has colored stripes with weaker intensity than those in the first car window image. The colored stripe processing model is generated based on at least two pairs of car window sample images, each pair including a first car window sample image with colored stripes and a second car window sample image without colored stripes corresponding to the first car window sample image. The technical solution provided by this invention, by processing car window images containing colored stripes using a colored stripe processing model, can effectively reduce or eliminate colored stripes in car window images, helping to reduce interference from colored stripes on intelligent recognition functions, thereby further improving the face recognition rate. Attached Figure Description
[0013] Figure 1 This is a flowchart of a method for processing colored patterns on car windows according to an embodiment of the present invention;
[0014] Figure 2 This is a structural block diagram of a car window texture processing model provided in an embodiment of the present invention;
[0015] Figure 3AThis is an image captured by a flash with low brightness and a long exposure time of the image sensor, as provided in an embodiment of the present invention.
[0016] Figure 3B This is an image captured by a flash with high brightness and a short exposure time of the image sensor, as provided in an embodiment of the present invention.
[0017] Figure 4 This is a schematic diagram of the structure of an image acquisition device provided in an embodiment of the present invention;
[0018] Figure 5 This is a schematic diagram of timing control of a flash and an image sensor provided in an embodiment of the present invention;
[0019] Figure 6A This is a schematic diagram illustrating the brightness variation of a common flash lamp according to an embodiment of the present invention;
[0020] Figure 6B This is a schematic diagram illustrating the brightness variation of a flash lamp with high peak brightness and low discharge time, provided by an embodiment of the present invention.
[0021] Figure 7 This is a schematic diagram illustrating the process of processing window patterns based on a window pattern processing model provided in an embodiment of the present invention.
[0022] Figure 8 This is a schematic diagram of the structure of a car window texture processing device provided in another embodiment of the present invention;
[0023] Figure 9 This is a schematic diagram of the structure of an electronic device according to another embodiment of the present invention. Detailed Implementation
[0024] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.
[0025] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0026] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0027] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0028] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0029] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0030] In related technologies, rotating the polarizing filter inside the camera by 90 degrees or integer multiples of 90 degrees within a preset exposure time can generate a corresponding complementary color for each stripe color on the car window. The different colors of light then superimpose to form white light, thus eliminating the colored stripes in the car window image. While theoretically it is feasible to eliminate colored stripes in car window images by controlling the rotation of the polarizing filter, implementing this solution requires a large-scale upgrade of the current intelligent traffic checkpoint camera hardware, making it cost-inefficient.
[0031] Figure 1 This is a flowchart illustrating a method for processing vehicle window textures according to an embodiment of the present invention. This embodiment is applicable to situations involving the processing of vehicle window textures. The method can be executed by a vehicle window texture processing device, which can consist of hardware and / or software and is generally integrated into an electronic device. For example... Figure 1 As shown, the method specifically includes the following steps:
[0032] Step 110: Extract the first window image from the image to be processed; wherein the first window image is an image containing colored stripes.
[0033] The image to be processed can be an image captured by a monitoring device (such as a front-end camera) at a traffic checkpoint. In this embodiment of the invention, the electronic device identifies the window area in the image to be processed and extracts the window image from it, thereby separating the image to be processed into a window image and a background image. For ease of description later, the window image extracted from the image to be processed is referred to as the first window image. In this embodiment of the invention, because a polarizing filter is installed in the monitoring device, and a film is usually applied to the window glass, when the monitoring device captures a vehicle, the combination of the polarizing filter and the window film causes the window portion in the captured image to contain colored stripes. Therefore, the first window image extracted from the image to be processed is an image containing colored stripes.
[0034] The electronic device can be a traffic checkpoint monitoring device (such as a camera), a terminal device such as a computer, or a server. It should be noted that this embodiment of the invention does not specifically limit the type of electronic device. In this embodiment, when the electronic device is a traffic checkpoint monitoring device, it can directly process the colored stripes in the window image of the image to be processed when it captures the image. When the electronic device is a terminal device or a server, it needs to obtain the image to be processed sent by the monitoring device before processing the colored stripes in the window image.
[0035] Step 120: Input the first window image into a pre-trained window color stripe processing model to obtain the second window image output by the window color stripe processing model; wherein, the second window image is an image without color stripes, or the intensity of the color stripes in the second window image is weaker than the intensity of the color stripes in the first window image.
[0036] The window stripe processing model is generated based on training on at least two pairs of window sample images. The window sample image pairs include a first window sample image with colored stripes and a second window sample image without colored stripes corresponding to the first window sample image.
[0037] The window smudge processing model is a machine learning model capable of quickly and accurately eliminating or reducing colored stripes in window images. Optionally, the window smudge processing model can be obtained by: acquiring a training sample set; wherein the training sample set includes at least two pairs of window sample images, each pair including a window sample image with colored stripes and a window sample image without colored stripes corresponding to the window sample image with colored stripes; and training a preset machine learning model based on the training sample set to generate the window smudge processing model.
[0038] In this embodiment of the invention, a training sample set is obtained, comprising at least two pairs of window sample images. Each pair of window sample images includes a window sample image with colored stripes and a window sample image without colored stripes. The window sample image without colored stripes can be a window sample image with colored stripes that has been processed to remove the colored stripes. A preset machine learning model is trained based on the training sample set until the loss function converges. The trained machine learning model is then used as the window shading processing model. During the training of the preset machine learning model based on the training sample set, the choice of loss function and optimizer is not limited; for example, L1 loss and the Adam optimizer can be used. In each training iteration, random cropping, flipping, and rotation can be used to randomly augment the data, and the specific training method is not limited; for example, common deep learning training strategies can be referenced. It should be noted that, to improve the training accuracy of the window shading processing model, each pair of window sample images in the training sample set can be images taken in different scenes.
[0039] Pre-defined machine learning models, also known as deep learning models, are currently used not only in high-level vision fields such as face recognition and license plate detection, with commonly used models including VGG, ResNet, and SSD, but also increasingly in low-level vision tasks such as image restoration and noise reduction. Commonly used models include U-net and CAN. Because models need to obtain full-resolution images when processing low-level vision tasks, Fully Convolutional Networks (FCNs) are a relatively good choice. Furthermore, the performance of FCN models in low-level vision tasks can be further improved by adding skip connections and downsampling-upsampling symmetric structures.
[0040] For example, the preset machine learning model is FCN, but in this embodiment of the invention, there are no restrictions on the number of model layers or the number of convolutional kernels in the FCN model. Figure 2 This is a structural block diagram of a vehicle window texture processing model provided in an embodiment of the present invention. Figure 2 As shown, the car window texture processing model contains 6 convolutional modules, each of which... A convolutional module is represented by a box, where each box represents a feature layer, and the number inside the box indicates the number of channels in the feature layer. The kernel size can be 3×3. From left to right, the first two convolutional modules each consist of one convolutional layer and one max-pooling layer; the third and sixth convolutional modules each contain only one convolutional layer; and the fourth and fifth convolutional modules each consist of one deconvolutional layer and one convolutional layer. The input and output of the car window texture processing model are both RGB data, with both input and output dimensions of H×W×3 (H and W represent the height and width of the car window image, respectively). Figure 2 As shown, the data dimension output by the first convolutional module is H / 2×W / 2×16; the data dimension output by the second convolutional module is H / 4×W / 4×32; the data dimension output by the third convolutional module is H / 4×W / 4×64; the fourth convolutional module contains a deconvolutional layer, which takes the data output by the second convolutional module (skip connection) and the third convolutional module as input, and outputs data with a data dimension of H / 2×W / 2×32; the fifth convolutional module contains a deconvolutional layer, which takes the data output by the first convolutional module (skip connection) and the fourth convolutional module as input, and outputs data with a data dimension of H×W×16; the data dimension output by the sixth convolutional module is H×W×3.
[0041] In this embodiment of the invention, a first window image is input into a pre-trained window stripe processing model. The model analyzes the first window image and processes the colored stripes in the first window image based on the analysis results to eliminate or reduce them. The output of the window stripe processing model is obtained. Since the model is an end-to-end machine learning model, the output is an image corresponding to the first window image. This image is then used as the second window image. The second window image either has no colored stripes or the intensity of the colored stripes in the second window image is weaker than that in the first window image.
[0042] It is understood that, in this embodiment of the invention, the window color pattern processing model can map a window image with colored stripes to a window image without colored stripes or with weakened colored stripe intensity.
[0043] This invention provides a method for processing colored stripes on vehicle windows. The method involves extracting a first vehicle window image from an image to be processed; wherein the first vehicle window image is an image containing colored stripes; inputting the first vehicle window image into a pre-trained colored stripe processing model to obtain a second vehicle window image output by the model; wherein the second vehicle window image is an image without colored stripes, or the intensity of the colored stripes in the second vehicle window image is weaker than the intensity of the colored stripes in the first vehicle window image. The technical solution provided by this invention, by processing a vehicle window image containing colored stripes using a colored stripe processing model, can effectively reduce or eliminate colored stripes in the vehicle window image, helping to reduce the interference of colored stripes on intelligent recognition functions, thereby further improving the face recognition rate.
[0044] In some embodiments, obtaining the training sample set includes: acquiring at least two pairs of vehicle sample images using an image acquisition device; wherein the vehicle sample image pair includes a first vehicle sample image and a second vehicle sample image, the first vehicle sample image containing a window image with colored stripes, and the second vehicle sample image containing a window image without colored stripes; performing pixel matching on the first vehicle sample image and the second vehicle sample image in the vehicle sample image pair; performing window detection on the pixel-matched first vehicle sample image and the second vehicle sample image, and based on the window detection results, extracting the window image with colored stripes from the pixel-matched first vehicle sample image, and extracting the window image without colored stripes from the pixel-matched second vehicle sample image; and using the extracted window image with colored stripes and the window image without colored stripes as window sample image pairs in the training sample set. The advantage of this setup is that it not only allows for the rapid and accurate acquisition of multiple pairs of window sample images, but also improves the training accuracy of the window stripe processing model, thereby helping to enhance the processing effect of the window stripe processing model on colored stripes in window images.
[0045] The inventors discovered in engineering practice that in nighttime scenes, colored stripes in images of tinted car windows captured by surveillance equipment (such as cameras) are significantly weakened or even invisible. By comparing nighttime and daytime capture scenes, they found the main difference lies in the intensity of sunlight. The lower the ratio of sunlight intensity and its refracted and reflected light intensity to the flash illumination intensity, the weaker the colored stripes in the captured car window image; conversely, the stronger the ambient light, the weaker the flash intensity, and the more obvious the colored stripes in the car window image; conversely, the weaker the ambient light intensity, the stronger the flash intensity, and the less obvious the colored stripes in the car window image. Therefore, by increasing the peak power of the flash in the surveillance equipment and reducing the exposure time of the image sensor (i.e., the optical sensor), the ratio of sunlight intensity and its refracted and reflected light intensity to the flash illumination intensity can be reduced, thus weakening the colored stripes in the car window image. In this context, the peak power of a flash can be understood as the flash brightness per unit time; the higher the peak power, the stronger the flash. The shorter the exposure time of the image sensor, the lower the cumulative ambient light brightness. However, due to the reduced exposure time and the limited range of the flash, the overall brightness of the captured image decreases, easily creating the illusion that the image brightness does not match the actual ambient light. For example, Figure 3A Figure 3A shows an image captured by a weak flash and a long exposure time of the image sensor, according to an embodiment of the present invention; Figure 3B shows an image captured by a strong flash and a short exposure time of the image sensor, according to an embodiment of the present invention. Clearly, Figure 3A The overall brightness of the image is relatively uniform, accurately reflecting the actual shooting environment, but... Figure 3A In the image of the vehicle window shown in Figure 3B, the colored stripes are obvious, making it impossible to accurately identify faces. In contrast, the image of the vehicle body in Figure 3B is brighter, and there are no obvious colored stripes in the window image, allowing for accurate face identification. However, the overall brightness of the background areas outside the vehicle is relatively dark, making it easy for viewers to perceive a mismatch between the captured image's brightness and the actual ambient light, resulting in a poor user experience. Therefore, while simply increasing the peak power of the flash in the monitoring equipment and reducing the exposure time of the image sensor can reduce the colored stripes in the window image, it still has certain drawbacks in practical applications. Especially given the high image quality requirements of intelligent traffic capture cameras, combining [the following methods] would be necessary. Figure 3A and Figure 3B The advantages of these two types of images will greatly enhance the competitiveness of snapshot cameras.
[0046] In this embodiment of the invention, at least two pairs of vehicle sample images under different scenarios are acquired using an image acquisition device. Each pair of vehicle sample images includes a first vehicle sample image containing a window image with colored stripes and a second vehicle sample image containing a window image without colored stripes. Optionally, acquiring at least two pairs of vehicle sample images using the image acquisition device includes: acquiring the first vehicle sample image using a first image acquisition module in the image acquisition device based on preset control conditions, and simultaneously acquiring the second vehicle sample image using a second image acquisition module in the image acquisition device. For example, the image acquisition device may include two image acquisition modules, each including a flash, a lens, an image sensor, and an image processing module; wherein the flash in one image acquisition module (which may be called the first image acquisition module) is a normal flash, and the flash in the other image acquisition module (which may be called the second image acquisition module) is a flash with high peak brightness and low discharge time. The image processing module in the first image acquisition module can control the corresponding image sensor to operate in a long exposure time and low gain mode through an exposure algorithm, and cooperate with the discharge of the normal flash, so that the image sensor in the first image acquisition module outputs the first vehicle sample image (e.g., ...). Figure 3A The second image acquisition module's image processing module can control the corresponding image sensor to operate in short exposure time and high gain mode through an exposure algorithm, and cooperate with the flash lamp with high peak brightness and low discharge time, so that the image sensor in the second image acquisition module outputs the second vehicle sample image (e.g., the image in the second image acquisition module). Figure 3B (Image in the image). In this embodiment of the invention, due to the difference in the physical positions of the image sensors in the two image acquisition modules, the actual acquired first vehicle sample image and second vehicle sample image do not completely overlap. Therefore, pixel-level matching can be performed on the first vehicle sample image and the second vehicle sample image. Pixel matching can be performed on the first vehicle sample image and the second vehicle sample image based on feature matching (such as SIFT) algorithms. It should be noted that this embodiment of the invention does not limit the pixel matching method. Then, window detection is performed on the pixel-matched first vehicle sample image and the second vehicle sample image. The coordinates of the window regions in the pixel-matched first vehicle sample image and the second vehicle sample image are determined respectively. Based on the coordinates of the window regions, window images are extracted from the matched vehicle sample images respectively. The window images extracted from the matched first vehicle sample image are window images with colored stripes, and the window images extracted from the matched second vehicle sample image are window images without colored stripes. The extracted window images with colored stripes and window images without colored stripes are used as window sample image pairs in the training sample set. The window images with colored stripes and window images without colored stripes are the same size.
[0047] It should be noted that the pixel matching operation and window detection operation for the vehicle sample image pairs can be performed by electronic devices or by image acquisition devices. When an image acquisition device performs pixel matching and window detection operations, the image acquisition device can include not only two image acquisition modules, but also a pixel matching module and a window detection module. For example, Figure 4 This is a schematic diagram of the structure of an image acquisition device provided in an embodiment of the present invention.
[0048] Optionally, the acquisition method of the at least two sets of window sample image pairs includes: acquiring the first window sample image through the first image acquisition module in the image acquisition device based on preset control conditions, and simultaneously acquiring the second window sample image through the second image acquisition module in the image acquisition device.
[0049] Optionally, the first image acquisition module includes a first flash and a first image sensor; the second image acquisition module includes a second flash and a second image sensor; the peak brightness of the second flash is greater than the peak brightness of the first flash, and the discharge time of the second flash is less than the discharge time of the first flash; the preset control conditions include: when the flash duration of the first flash reaches a first preset time, the first image sensor begins exposure; when the exposure of the first image sensor ends, the second flash begins to flash, and when the flash duration of the second flash reaches a second preset time, the second image sensor begins exposure. The advantage of this setting is that it can further improve the quality of the acquired vehicle sample image pairs, especially the quality of vehicle sample images containing window images without color stripes.
[0050] In this embodiment of the invention, the higher the peak power of the flash, the higher the peak brightness of the flash, and correspondingly, the greater the flash illumination intensity. The peak brightness of the flash can be understood as the maximum brightness of the flash. By using a flash with a higher peak brightness for illumination, the ratio of sunlight and its refracted and reflected light to the flash illumination intensity can be reduced during image capture. A shorter flash discharge time indicates a shorter flash duration. By using a flash with a low discharge time and shortening the exposure time of the second image sensor, the difference between the images of moving objects captured by the first and second image sensors can be reduced.
[0051] In this embodiment of the invention, when a first vehicle sample image is acquired by the first image acquisition module in the image acquisition device, and a second vehicle sample image is acquired by the second image acquisition module in the image acquisition device, in response to the triggering of an image acquisition event, the first flash starts flashing. Since the flash brightness is low when it is first activated, the first image sensor starts exposure after a certain delay, that is, the first image sensor starts exposure after the first flash has flashed for a first preset time. The first preset time can be understood as the delayed exposure time of the first image sensor, and can be set manually based on experience. When the first image sensor finishes exposure, the second flash starts flashing. When the second flash starts flashing, the first flash can continue flashing or stop flashing. This embodiment of the invention does not limit the working state of the first flash when the second flash starts flashing. Similarly, since the second flash brightness is low when it is first activated, the second image sensor starts exposure after the second flash has flashed for a second preset time. The second preset time can be understood as the delayed exposure time of the second image sensor, and can also be set manually based on experience.
[0052] Optional, Figure 5 This is a schematic diagram illustrating the timing control of a flash and an image sensor according to an embodiment of the present invention. To stagger the flash timing of the first and second flashes and prevent flash brightness overlap, the preset control conditions provided in this embodiment of the invention satisfy the following... Figure 5 The timing control conditions are shown. For example... Figure 5 As shown, when the image acquisition device receives the capture command at times t1 and t4, the first flash starts firing. When the flash duration reaches the first preset time Δt1, the first image sensor begins exposure, that is, the first image sensor begins exposure at t1 + Δt1, and the exposure duration of the first image sensor is ΔT1. The second flash starts firing when the first image sensor's exposure ends, that is, at time t3 = t1 + Δt1 + ΔT1. The second image sensor begins exposure after the second flash has fired for the second preset time Δt2, that is, the second image sensor begins exposure at t3 + Δt2, and the exposure duration of the second image sensor is ΔT2.
[0053] In this embodiment of the invention, to minimize the proportion of sunlight during the image sensor's exposure time in order to obtain a texture-free image, the following three methods can be used: reducing the image sensor's exposure time / shortening the flash discharge time, increasing the flash peak power, and shifting the sensor's exposure time to a period when the flash brightness is higher than the ambient brightness. Therefore, the preset control conditions further include: the exposure time of the first image sensor and the exposure time of the second image sensor, as well as the gain of the first image sensor and the gain of the second image sensor, satisfying a preset relationship condition; wherein the preset relationship condition includes:
[0054] ΔT2=ΔT1 / N
[0055] ΔT2=min(ΔT2,t2-Δt2)
[0056] G2=ΔT1*G1 / ΔT2
[0057] in,
[0058]
[0059] Δt2=min(Δt2,t2)
[0060] Wherein, ΔT1 represents the exposure time of the first image sensor, ΔT2 represents the exposure time of the second image sensor, G1 represents the gain of the first image sensor, G2 represents the gain of the second image sensor, Δt2 represents the second preset time, t2 represents the effective discharge time of the second flash, M represents the first preset constant, and N represents the second preset constant.
[0061] The exposure time ΔT1 of the first image sensor can be implemented based on a conventional automatic exposure control algorithm. For example, it can use the average brightness of the image as statistical information, pre-set the exposure target value, and adjust the shutter speed / gain to smoothly converge the real-time acquired brightness statistics to the exposure target value. For a given flash unit, its effective discharge time is fixed. Furthermore, N > 1, and N can be adaptively adjusted according to the noise level of the image acquired by the second image sensor; the more significant the image noise, the smaller N. It should be noted that a larger product of the image sensor's exposure time and gain indicates lower ambient brightness; conversely, a smaller product indicates higher ambient brightness.
[0062] In some embodiments, the preset time is determined in at least one of the following ways: acquiring a first ambient light intensity; determining a preset time corresponding to the ambient light intensity based on the first ambient light intensity and a pre-set direct proportional relationship between the ambient light intensity and the preset time; wherein, the greater the ambient light intensity, the longer the preset time; or, acquiring a second ambient light intensity and a brightness curve of the flash lamp; determining a preset time corresponding to the flash lamp based on the second ambient light intensity and the brightness curve of the flash lamp; wherein, when the flash duration of the flash lamp reaches the corresponding preset time, the brightness of the flash lamp is greater than or equal to the second ambient light intensity.
[0063] In this embodiment of the invention, the method for determining the preset time includes determining a first preset time and a second preset time. Since the delayed exposure time of the image sensor is proportional to the ambient brightness, when determining the preset time, the ambient light brightness can be obtained. Based on the ambient light brightness and a pre-set direct proportionality relationship between the ambient light brightness and the preset time, the preset time corresponding to the ambient light brightness is calculated. Specifically, the higher the ambient light brightness, the longer the preset time; conversely, the lower the ambient light brightness, the shorter the preset time. It should be noted that the direct proportionality relationship is different when determining the first preset time and the second preset time. Specifically, the ratio of ambient light brightness to the first preset time is greater than the ratio of ambient light brightness to the second preset time.
[0064] For example, the preset time can also be determined based on the ambient light intensity and the brightness curve of the flash. Figure 6A This is a schematic diagram illustrating the brightness variation of a common flash lamp, provided as an embodiment of the present invention. Figure 6B This diagram illustrates the brightness variation of a flash lamp with high peak brightness and low discharge time, as provided in an embodiment of the present invention. During the flash lamp's discharge time (typically in the hundreds of microseconds range), the solar illuminance remains essentially constant; therefore, the ambient light intensity during the flash lamp's discharge time can be considered fixed. Figure 6A and Figure 6B As shown, when the image sensor delays the exposure for a preset time, the brightness of the flash is greater than the current ambient light brightness.
[0065] In some embodiments, after obtaining the second window image output by the window color pattern processing model, the method further includes: fusing the second window image with a background image in the image to be processed to generate a target image; wherein the image to be processed includes a background image and the first window image. In this embodiment of the invention, the image to be processed includes a first window image and a background image, wherein the background image can be understood as any image in the image to be processed other than the first window image. Fusing the second window image with the background image in the image to be processed can also be understood as covering or replacing the first window image with the second window image to generate the target image. The target image contains a window image without color stripes, or the intensity of the color stripes in the window image is weaker than the intensity of the color stripes in the window image contained in the image to be processed.
[0066] Figure 7 This is a schematic diagram illustrating the process of processing window patterns based on a window pattern processing model provided in an embodiment of the present invention.
[0067] Figure 8 This is a schematic diagram of a vehicle window texture processing device according to another embodiment of the present invention. Figure 8 As shown, the device includes: a window image extraction module 810 and a window image processing module 820. Among them,
[0068] The window image extraction module 810 is used to extract a first window image from the image to be processed; wherein, the first window image is an image containing colored stripes;
[0069] The window image processing module 820 is used to input the first window image into a pre-trained window color stripe processing model to obtain a second window image output by the window color stripe processing model; wherein, the second window image is an image without color stripes, or the intensity of the color stripes in the second window image is weaker than the intensity of the color stripes in the first window image; the window color stripe processing model is generated based on training based on at least two sets of window sample image pairs, the window sample image pairs including a first window sample image with color stripes and a second window sample image without color stripes corresponding to the first window sample image.
[0070] This invention provides a vehicle window chromatic stripe processing device. The device extracts a first vehicle window image from an image to be processed. The first vehicle window image contains colored stripes. The first vehicle window image is input into a pre-trained vehicle window chromatic stripe processing model to obtain a second vehicle window image output by the model. The second vehicle window image is either without colored stripes or has colored stripes with weaker intensity than those in the first vehicle window image. The vehicle window chromatic stripe processing model is generated based on at least two pairs of vehicle window sample images, each pair including a first vehicle window sample image with colored stripes and a second vehicle window sample image without colored stripes corresponding to the first image. The technical solution provided by this invention, by processing vehicle window images containing colored stripes using a vehicle window chromatic stripe processing model, can effectively reduce or eliminate colored stripes in vehicle window images, helping to reduce interference from colored stripes on intelligent recognition functions, thereby further improving the face recognition rate.
[0071] Optionally, the device further includes a sample set acquisition module, which is used to acquire the at least two sets of window sample image pairs;
[0072] The sample set acquisition module includes:
[0073] The vehicle image pair acquisition unit is used to acquire at least two sets of vehicle sample image pairs through an image acquisition device; wherein, the vehicle sample image pair includes a first vehicle sample image and a second vehicle sample image, the first vehicle sample image includes a window image with colored stripes, and the second vehicle sample image includes a window image without colored stripes.
[0074] A pixel matching unit is used to perform pixel matching on the first vehicle sample image and the second vehicle sample image in the vehicle sample image pair;
[0075] The window image detection unit is used to perform window detection on the first vehicle sample image and the second vehicle sample image after pixel matching, and extract the window image with colored stripes from the first vehicle sample image after pixel matching and the window image without colored stripes from the second vehicle sample image after pixel matching based on the window detection results.
[0076] The window image pair acquisition unit is used to extract window images with colored stripes and window images without colored stripes as window sample image pairs in the training sample set.
[0077] Optionally, the acquisition method of the at least two sets of window sample image pairs includes:
[0078] Based on preset control conditions, the first vehicle sample image is acquired by the first image acquisition module in the image acquisition device, and the second vehicle sample image is acquired by the second image acquisition module in the image acquisition device.
[0079] Optionally, the first image acquisition module includes a first flash and a first image sensor; the second image acquisition module includes a second flash and a second image sensor; the peak brightness of the second flash is greater than the peak brightness of the first flash, and the discharge time of the second flash is less than the discharge time of the first flash.
[0080] The preset control conditions include: when the flash duration of the first flash reaches a first preset time, the first image sensor begins to expose; when the exposure of the first image sensor ends, the second flash starts to flash, and when the flash duration of the second flash reaches a second preset time, the second image sensor begins to expose.
[0081] Optionally, the preset control conditions further include: the exposure time of the first image sensor and the exposure time of the second image sensor, and the gain of the first image sensor and the gain of the second image sensor satisfying preset relationship conditions;
[0082] The preset relationship conditions include:
[0083] ΔT2=ΔT1 / N
[0084] ΔT2=min(ΔT2,t2-Δt2)
[0085] G2=ΔT1*G1 / ΔT2
[0086] in,
[0087]
[0088] Δt2=min(Δt2,t2)
[0089] Wherein, ΔT1 represents the exposure time of the first image sensor, ΔT2 represents the exposure time of the second image sensor, G1 represents the gain of the first image sensor, G2 represents the gain of the second image sensor, Δt2 represents the second preset time, t2 represents the effective discharge time of the second flash, M represents the first preset constant, and N represents the second preset constant.
[0090] Optionally, the preset time can be determined in at least one of the following ways:
[0091] Obtain a first ambient light intensity; determine a preset time corresponding to the first ambient light intensity and a pre-set direct proportional relationship between the ambient light intensity and a preset time; wherein, the higher the ambient light intensity, the longer the preset time; or,
[0092] Obtain the second ambient light intensity and the brightness curve of the flash; determine the preset time corresponding to the flash based on the second ambient light intensity and the brightness curve of the flash; wherein, when the flash duration of the flash reaches the corresponding preset time, the brightness of the flash is greater than or equal to the second ambient light intensity.
[0093] Optionally, the device further includes:
[0094] The image fusion module is used to fuse the second window image with the background image in the image to be processed after the second window image output by the window texture processing model is obtained, to generate a target image; wherein the image to be processed includes the background image and the first window image.
[0095] The above-described apparatus can execute the methods provided in all the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in the embodiments of the present invention can be found in the methods provided in all the foregoing embodiments of the present invention.
[0096] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the window tint processing method provided in this invention.
[0097] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0098] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the window tint processing operation as described above, but can also execute related operations in the window tint processing method provided in any embodiment of the present invention.
[0099] This invention provides an electronic device that can integrate the window texture processing device provided in this invention. Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 900 may include: a memory 901, a processor 902, and a computer program stored in the memory 901 and executable on the processor. When the processor 902 executes the computer program, it implements the window tint processing method as described in the embodiment of the present invention.
[0100] The electronic device provided in this embodiment of the invention extracts a first window image from an image to be processed; wherein the first window image is an image containing colored stripes; the first window image is input into a pre-trained window stripe processing model to obtain a second window image output by the window stripe processing model; wherein the second window image is an image without colored stripes, or the intensity of the colored stripes in the second window image is weaker than the intensity of the colored stripes in the first window image; the window stripe processing model is generated based on training on at least two sets of window sample image pairs, wherein the window sample image pairs include a first window sample image with colored stripes and a second window sample image without colored stripes corresponding to the first window sample image. The technical solution provided in this embodiment of the invention, by processing window images containing colored stripes through a window stripe processing model, can effectively reduce or eliminate colored stripes in window images, helping to reduce the interference of colored stripes on intelligent recognition functions, thereby further improving the face recognition rate.
[0101] The window texture processing device, storage medium, and electronic device provided in the above embodiments can execute the window texture processing method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the window texture processing method provided in any embodiment of the present invention.
[0102] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for processing colored patterns on car windows, characterized in that, include: Extract the first window image from the image to be processed; wherein, the first window image is an image containing colored stripes; The first window image is input into a pre-trained window pattern processing model to obtain a second window image output by the model; wherein the second window image is an image without colored stripes, or the intensity of the colored stripes in the second window image is weaker than the intensity of the colored stripes in the first window image; the window pattern processing model is generated based on training on at least two pairs of window sample images, wherein the pair of window sample images includes a first window sample image with colored stripes and a second window sample image without colored stripes corresponding to the first window sample image; The acquisition methods for the at least two sets of window sample image pairs include: Based on preset control conditions, the first image acquisition module in the image acquisition device acquires a sample image of the first vehicle window, and the second image acquisition module in the image acquisition device acquires a sample image of the second vehicle window simultaneously; the first image acquisition module includes a first flash and a first image sensor; the second image acquisition module includes a second flash and a second image sensor; the peak brightness of the second flash is greater than the peak brightness of the first flash, and the discharge time of the second flash is less than the discharge time of the first flash. The preset control conditions include: when the flash duration of the first flash reaches a first preset time, the first image sensor begins to expose; when the exposure of the first image sensor ends, the second flash starts to flash, and when the flash duration of the second flash reaches a second preset time, the second image sensor begins to expose. The preset time is determined in at least one of the following ways: Obtain a first ambient light intensity; determine a preset time corresponding to the first ambient light intensity and a pre-set direct proportional relationship between the ambient light intensity and a preset time; wherein, the higher the ambient light intensity, the longer the preset time; or, Obtain the second ambient light intensity and the brightness curve of the flash; determine the preset time corresponding to the flash based on the second ambient light intensity and the brightness curve of the flash; wherein, when the flash duration of the flash reaches the corresponding preset time, the brightness of the flash is greater than or equal to the second ambient light intensity.
2. The method according to claim 1, characterized in that, The acquisition methods for the at least two sets of window sample image pairs include: At least two pairs of vehicle sample images are acquired using an image acquisition device; wherein, the vehicle sample image pair includes a first vehicle sample image and a second vehicle sample image, the first vehicle sample image includes a window image with colored stripes, and the second vehicle sample image includes a window image without colored stripes. Pixel matching is performed on the first vehicle sample image and the second vehicle sample image in the vehicle sample image pair; Window detection is performed on the first and second vehicle sample images after pixel matching. Based on the window detection results, window images with colored stripes are extracted from the first vehicle sample image after pixel matching, and window images without colored stripes are extracted from the second vehicle sample image after pixel matching. The extracted images of car windows with colored stripes and those without colored stripes are used as pairs of car window sample images in the training sample set.
3. The method according to claim 1, characterized in that, The preset control conditions also include: the exposure time of the first image sensor and the exposure time of the second image sensor, and the gain of the first image sensor and the gain of the second image sensor satisfying preset relationship conditions; The preset relationship conditions include: ΔT2=ΔT1 / N ΔT2=min(ΔT2,t2-Δt2) G2=ΔT1*G1 / ΔT2 in, Δt2=min(Δt2,t2) Wherein, ΔT1 represents the exposure time of the first image sensor, ΔT2 represents the exposure time of the second image sensor, G1 represents the gain of the first image sensor, G2 represents the gain of the second image sensor, Δt2 represents the second preset time, t2 represents the effective discharge time of the second flash, M represents the first preset constant, and N represents the second preset constant.
4. The method according to any one of claims 1-3, characterized in that, After obtaining the second window image output by the window texture processing model, the method further includes: The second window image is fused with the background image in the image to be processed to generate a target image; wherein the image to be processed includes the background image and the first window image.
5. A device for processing colored patterns on vehicle windows, characterized in that, include: A vehicle window image extraction module is used to extract a first vehicle window image from an image to be processed; wherein, the first vehicle window image is an image containing colored stripes; A window image processing module is used to input the first window image into a pre-trained window color stripe processing model to obtain a second window image output by the window color stripe processing model; wherein, the second window image is an image without color stripes, or, the intensity of the color stripes in the second window image is weaker than the intensity of the color stripes in the first window image; the window color stripe processing model is generated based on training based on at least two sets of window sample image pairs, wherein the window sample image pairs include a first window sample image with color stripes and a second window sample image without color stripes corresponding to the first window sample image; The acquisition methods for the at least two sets of window sample image pairs include: Based on preset control conditions, the first image acquisition module in the image acquisition device acquires a sample image of the first vehicle window, and the second image acquisition module in the image acquisition device acquires a sample image of the second vehicle window simultaneously; the first image acquisition module includes a first flash and a first image sensor; the second image acquisition module includes a second flash and a second image sensor; the peak brightness of the second flash is greater than the peak brightness of the first flash, and the discharge time of the second flash is less than the discharge time of the first flash. The preset control conditions include: when the flash duration of the first flash reaches a first preset time, the first image sensor begins to expose; when the exposure of the first image sensor ends, the second flash starts to flash, and when the flash duration of the second flash reaches a second preset time, the second image sensor begins to expose. The preset time is determined in at least one of the following ways: Obtain a first ambient light intensity; determine a preset time corresponding to the first ambient light intensity and a pre-set direct proportional relationship between the ambient light intensity and a preset time; wherein, the higher the ambient light intensity, the longer the preset time; or, Obtain the second ambient light intensity and the brightness curve of the flash; determine the preset time corresponding to the flash based on the second ambient light intensity and the brightness curve of the flash; wherein, when the flash duration of the flash reaches the corresponding preset time, the brightness of the flash is greater than or equal to the second ambient light intensity.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the window texture processing method as described in any one of claims 1-4.
7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the window tint processing method as described in any one of claims 1-4.