Vehicle-mounted camera anti-flicker method
Through the two exposure and long-term exposure technology of the on-board camera, the compensating images are acquired and weighted, and the problem of difficulty in collecting high-quality images under the flickering light source is solved, achieving the brightness stability and the details of HDR images.
Patent Information
- Application Number
- CN202411586324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-14
AI Technical Summary
Existing on-board cameras are difficult to acquire high-quality images in complex environments, especially under flicker light sources, making it difficult to achieve high-quality HDR image capture and suppress flicker effect.
Through the two exposure and long-term exposure techniques, the first compensation image is obtained and brightness-weighted amplification is performed to generate a second compensation image to offset the periodic fluctuation of the light source and achieve a balance between bright and dark details.
It effectively reduces the light and dark stripes in the image, provides a brightness-stable image, and improves the detail richness and visual effects of HDR images.
Smart Images

Figure CN119450233A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of camera anti-flickering, in particular to a vehicle-mounted camera anti-flickering method. Background Art
[0002] The current technical bottlenecks of intelligent driving of automobiles are mainly concentrated in three aspects: perception, decision-making and understanding. Among them, how the image sensor of the automobile camera can effectively collect high-quality on-board camera images in complex environments and provide stable and high-quality data for the back-end decision-making and understanding layer is a major challenge currently faced. In the existing technology, there are two shutter modes for on-board image sensors: rolling shutter and global shutter. These two shutter modes have their own characteristics and application scenarios in CMOS image sensors. Although the global shutter sensor can avoid flicker in principle, in actual applications, due to the high manufacturing cost of the global shutter image sensor itself, the performance has defects or instability, and when the brightness range of the light source varies greatly, the dynamic range of the sensor is insufficient, and it cannot meet the needs of on-board forward-looking applications, which will lead to a decrease in image quality. Therefore, global shutter image sensors are rarely used in on-board forward-looking cameras. The rolling shutter image sensor will have image flickering at night for AC-powered light sources, which is usually called "flicker" or "striping" phenomenon.
[0003] Patent document CN111935366A discloses a camera device anti-flicker method and system, a camera device and a control method thereof. However, it and the prior art still lack a method for capturing high-quality HDR images under a flickering light source and effectively suppressing the flicker effect while retaining the details of the bright and dark parts. Summary of the invention
[0004] In view of the deficiencies of the prior art, the present invention provides a method for preventing flickering of a vehicle-mounted camera, which solves the technical problems raised in the background art through double exposure and long and short exposure technologies.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0006] A vehicle-mounted camera anti-flicker method is applied to the vehicle-mounted camera, and the anti-flicker method includes:
[0007] S1, obtaining a first compensation image, where the first compensation image is used to represent a single exposure image after the periodic fluctuation of the light source is offset;
[0008] S2, obtaining a first compensated image generated under multiple different exposure times; wherein the multiple different exposure times include: a short exposure time for capturing bright details, and a long exposure time for capturing dark details
[0009] S3. Perform brightness-weighted amplification on the first compensated images generated at multiple different exposure times to obtain a second compensated image; wherein the second compensated image is used to represent an HDR image that achieves a balance between bright details and dark details after offsetting periodic fluctuations of the light source.
[0010] In some embodiments, acquiring a first compensated image includes:
[0011] S1-1, detecting the periodic fluctuation of the light source, and graphing the periodic fluctuation to obtain a sine wave curve of the light source;
[0012] S1-2, identify the peaks and troughs on the sine wave curve and determine the sine wave period;
[0013] S1-3. Perform secondary exposure on the image sensor of the vehicle-mounted camera according to the sine wave period of the light source to obtain a first compensated image.
[0014] In some of the embodiments, performing a secondary exposure on an image sensor of a vehicle-mounted camera includes:
[0015] S1-3-1. Start the first exposure at any time point within the sine wave period to obtain a first exposure image; wherein the first exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a first integrated brightness value, and generating the first exposure image based on the first integrated brightness value;
[0016] The expression for generating the first integrated brightness value is:
[0017] L T1 Indicates that at the first exposure time T ia P(t) represents the instantaneous brightness value of the light source at time t. ia represents the duration of the first exposure, t0 is the start time of the first exposure, ∫ represents the integral operation, that is, P(t) is in the interval [t0, t0+T ia ], dt represents the small time increment used in the integration operation, which is used to integrate the time t;
[0018] S1-3-2, after half a sine wave cycle after the first exposure, start the second exposure to obtain a second exposure image; wherein the second exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a second integrated brightness value, and generating a second exposure image based on the second integrated brightness value;
[0019] The expression for generating the second integrated brightness value is:
[0020] L T2Indicates that at the second exposure time T ia The accumulated brightness value within Indicates the start time of the second exposure, which is delayed by half a flash cycle relative to the start time of the first exposure
[0021] S1-3-3, summing and averaging the brightness values of the first exposure image and the second exposure image to determine a first compensation brightness value;
[0022] The expression of the first compensation brightness value is:
[0023] L C1 represents the first compensation brightness value;
[0024] S1-3-4, generating a first compensated image according to the first compensated brightness value;
[0025] In some embodiments, acquiring a first compensation image generated at a plurality of different exposure times includes:
[0026] S2-1, define a short exposure time, which is used to capture a camera scene with higher brightness;
[0027] S2-2, define a long exposure time, which is used to capture a camera scene with low brightness;
[0028] S2-3, based on the center points of the short exposure time and the long exposure time, determine the time between the center points as a reference offset;
[0029] S2-4, performing secondary exposure on the image sensor of the vehicle-mounted camera within the short exposure time to obtain a short exposure compensation image;
[0030] S2-5, starting from the center point of the short exposure time, determining the starting point of the long exposure time according to the reference offset;
[0031] S2-6. From the starting point of the long exposure time, perform a secondary exposure on the image sensor of the vehicle-mounted camera to obtain a long exposure compensation image.
[0032] In some embodiments, according to a plurality of first compensation images generated at different exposure times, brightness weighted amplification is performed on the first compensation images to obtain a second compensation image, including:
[0033] S3-1, determining a ratio of a long exposure time to a short exposure time according to the exposure time corresponding to each first compensated image;
[0034] S3-2, using the ratio, weightedly amplifying the brightness value of the short exposure compensation image to obtain a short exposure weighted image;
[0035] S3-3, adding the brightness values of the short-exposure weighted image and the long-exposure compensated image to determine a second compensated brightness value;
[0036] S3-4. Generate a second compensated image according to the second compensated brightness value.
[0037] The expression for determining the second compensation brightness value is:
[0038] L C2 Indicates the second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensated image.
[0039] In some embodiments, according to the first compensation images generated at multiple different exposure times, brightness weighted amplification is performed on them to obtain the second compensation image, including:
[0040] D3-1, calculating the gradient values of the short exposure compensation image and the long exposure compensation image, and defining them as brightness weighting coefficients;
[0041] The expression for calculating the gradient value of the short exposure compensation image and the long exposure compensation image is:
[0042]
[0043] G S Represents the gradient value of the short exposure compensation image, which is used to characterize the changes in bright details;
[0044] G L Indicates the gradient value of the long exposure compensation image, which is used to characterize the changes in dark details;
[0045] and Respectively represent the absolute values of the time change rates of the brightness values of the short exposure compensation image and the long exposure compensation image;
[0046] D3-2, determining brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image according to the gradient values of the short exposure compensation image and the long exposure compensation image;
[0047] The expression of brightness weighting coefficient is:
[0048]
[0049] w S Represents the weight coefficient of the short exposure compensation image, w L represents the weight coefficient of the long exposure compensation image,
[0050] D3-3, determining a second compensation brightness value according to brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image;
[0051] L C2 =w S ·L S +w L ·L L ;
[0052] L C2 The second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensation image;
[0053] D3-4. Generate a second compensated image according to the second compensated brightness value.
[0054] In some of the embodiments, the camera includes a light source periodic fluctuation detection module and an exposure control module; the light source periodic fluctuation detection module is used to obtain the sinusoidal wave period of the light source and determine the peaks and troughs.
[0055] In some of the embodiments, the camera also includes a weighting module; the weighting module is used to amplify the brightness of the short exposure compensation image according to the ratio of the long exposure time to the short exposure time, and add the amplified short exposure compensation image to the long exposure compensation image to generate an HDR image.
[0056] In some of these embodiments, the camera adapts to different light source frequencies to adjust exposure time.
[0057] The present invention provides a method for preventing a vehicle-mounted camera from flickering, which has the following beneficial effects:
[0058] By using two exposures (the first exposure and the second exposure delayed by half a flicker cycle) to compensate for the periodic fluctuations of the light source, the brightness value obtained is more stable and the light and dark stripes in the image are reduced. The compensated brightness value obtained by averaging the results of the two exposures effectively offsets the impact of periodic brightness fluctuations. It can keep the exposure brightness of each row of the rolling shutter consistent, reduce the impact of flicker on the image, and thus provide an image with stable brightness.
[0059] Furthermore, through different brightness compensation of short exposure time and long exposure time, the bright details and dark details are made richer. Its gradient information directly reflects the rate of brightness change, which can better highlight the richness of image details. After gradient weighting, both the bright and dark areas of the image can obtain appropriate details, further improving the expressiveness of HDR images, making the final image more visually appealing and detailed. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A flow chart of an anti-flickering method for a vehicle-mounted camera according to the present invention;
[0061] Figure 2 A flow chart for generating a first compensation image for the present invention;
[0062] Figure 3 Flowchart for generating a second compensated image for the present invention. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] Embodiment 1: In this embodiment, the application scenario of the image sensor is the light signal acquisition of the vehicle-mounted camera, so it must use an electronic rolling shutter type image sensor. For the sensor of the electronic rolling shutter, each row of the rolling shutter has an exposure time of a duration (i.e., the "exposure time" of each row), and there is an interval between the exposure times of the upper and lower rows, similar to the dark time between the rows and the exposure time of each row. This exposure time is formed because of the working mode of the rolling shutter. The rolling shutter is different from the global shutter. It does not expose the entire image at the same time, but exposes it row by row. More specifically, in the rolling shutter mode, the pixels on the image sensor do not start and end the exposure at the same time, but are exposed row by row in sequence. The length of the exposure time is usually the same, that is, the exposure time of each row of the sensor is consistent. This is because the number of pixels and the pixel spacing of the sensor are consistent, resulting in the same exposure time for each row. Because there is an exposure time interval between rows, a flicker effect is formed. The flicker effect is manifested in that when bright flickering light exists, the exposure time may be shorter than the flicker period. Because each row of the rolling shutter is exposed at a different part of the sinusoidal curve period, the collected image may appear as alternating light and dark ripples.
[0065] Based on this, reference Figure 1-Figure 3 Embodiment 1 discloses a method for preventing flickering of a vehicle-mounted camera, which is applied to a vehicle-mounted camera. The steps of the method for preventing flickering include:
[0066] S1. Obtain a first compensation image, where the first compensation image is used to represent a single exposure image after the periodic fluctuation of the light source is offset, so that the brightness of the first compensation image remains stable and the flicker caused by the periodic fluctuation of the light source itself is removed.
[0067] S1 specifically includes:
[0068] S1-1, detecting the periodic fluctuation of the light source, and graphing the periodic fluctuation to obtain a sine wave curve of the light source;
[0069] S1-2, identify the peaks and troughs on the sine wave curve and determine the sine wave period;
[0070] S1-3. Perform secondary exposure on the image sensor of the vehicle-mounted camera according to the sine wave period of the light source to obtain a first compensated image.
[0071] S1-3 specifically includes:
[0072] S1-3-1. Start the first exposure at any time point within the sine wave period to obtain a first exposure image; wherein the first exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a first integrated brightness value, and generating the first exposure image based on the first integrated brightness value;
[0073] The expression for generating the first integrated brightness value is:
[0074] L T1 Indicates that at the first exposure time T ia P(t) represents the instantaneous brightness value of the light source at time t. ia represents the duration of the first exposure, t0 is the start time of the first exposure, ∫ represents the integral operation, that is, P(t) is in the interval [t0, t0+T ia ], dt represents the small time increment used in the integration operation, which is used to integrate the time t;
[0075] Specifically, on the sine wave curve of the light source, the horizontal axis is time and the vertical axis is the instantaneous brightness value. The peak position of the sine wave is the time point with the highest brightness value, and the image collected by the first exposure is the image with the highest brightness.
[0076] Specifically, in order to solve the problem of light and dark ripples, in this embodiment, two exposures are performed on the same row of the rolling shutter. That is, integration is performed on the sine waves of the first exposure and the second exposure respectively to obtain the integrated brightness values collected during the first exposure and the second exposure respectively. Specifically, during the first exposure and the second exposure, the light intensity collected by the image sensor will present a sine wave as time changes. Therefore, integrating it is to solve the area under the sine wave curve during the exposure time, and the area is the integrated brightness value during the two exposure times.
[0077] In this embodiment, the first exposure and the second exposure have the same length, but the second exposure is shifted backward by half a flashing period Tf / 2 relative to the first exposure. Therefore, when the sine wave is integrated over two intervals of equal length, the DC component of the sine wave over a period of time, i.e., the average value, is obtained.
[0078] Furthermore, the positions of the first exposure and the second exposure are relatively fixed, and there is no need to define their specific relative positions on the sine wave, that is, the exposure is performed at any time point within the sine wave period.
[0079] S1-3-2, after half a sine wave cycle after the first exposure, start the second exposure to obtain a second exposure image; wherein the second exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a second integrated brightness value, and generating a second exposure image based on the second integrated brightness value;
[0080] The expression for generating the second integrated brightness value is:
[0081] L T2 Indicates that at the second exposure time T ia The accumulated brightness value within Indicates the start time of the second exposure, which is delayed by half a flash cycle relative to the start time of the first exposure
[0082] Specifically, in the periodic fluctuation of a sine wave, after a delay of half a sine wave period (i.e., Tf / 2), it will generally cross the peak or trough and enter a relative brightness position. For example:
[0083] If the first exposure sampling moment happens to be at the peak, then after half a cycle it will be at the trough, at which point the brightness is lowest. If the first exposure sampling moment is at any position (not necessarily at the peak), it will also move to the relative position of the sine wave after a delay of half a cycle, obtaining an image with decreasing or increasing brightness. In other words, the position of the second exposure image depends on the position of the first exposure image pair.
[0084] In a sine wave, the brightness switches from one extreme value (peak or trough) to another extreme value in each half cycle. Therefore, an exposure delayed by half a cycle usually samples a different brightness value from the first exposure. The half-cycle delay ensures that the second exposure is sampled at the relative brightness position of the sine wave. That is, by delaying half a cycle, the brightness of the two samples can be symmetrical.
[0085] S1-3-3, summing and averaging the brightness values of the first exposure image and the second exposure image to determine a first compensation brightness value;
[0086] The expression of the first compensation brightness value is:
[0087] L C1 represents the first compensation brightness value;
[0088] S1-3-4. Generate a first compensated image based on the first compensated brightness value; referring to Fig. 3, after the image sensor collects the light source signal during the first exposure and second exposure time periods, the integral brightness values of the first exposure image and the second exposure image are summed and averaged to generate a first compensated integral brightness value, and a first compensated image is generated based on the first compensated integral brightness value to eliminate the flicker effect.
[0089] In this embodiment, the significance of the first compensation image is that under a periodically fluctuating light source (for example, an AC-driven light source with a frequency of 50 Hz or 60 Hz), the brightness of the light source will change periodically in the form of a sine wave, causing fluctuations in the brightness of the image captured by the vehicle-mounted camera. This brightness fluctuation appears as light and dark stripes or flickering in the image, which is more obvious in the case of short exposure time. Therefore, the significance of the first compensation image is to eliminate the influence of the periodic fluctuation of the light source and provide an image with stable brightness and no flicker. It can provide a "baseline brightness" of light source fluctuations for the vehicle-mounted camera, so that the subsequently generated images are no longer affected by the light source fluctuations, ensuring the brightness consistency of the image.
[0090] For example, for a light source using a 50Hz mains frequency (generating 100Hz brightness fluctuation), half a flicker period is 5ms; for a 60Hz mains frequency (generating 120Hz brightness fluctuation), half a flicker period is 4.17ms. That is, the time of half a flicker period is usually less than the frame period of the sensor, so in each frame, the image sensor can be designed to capture two images, namely the first exposure image and the second exposure image.
[0091] Example 2: See Figures 2 to 3 The technical solution of this embodiment 2 is different from that of embodiment 1 in that it discloses a method for obtaining an HDR image based on a flicker compensation image.
[0092] In this embodiment, the flicker compensation technology can use a common image sensor interface, and only needs to control the image sensor to take two consecutive images with the same exposure time. The time offset D between the two exposures is an integer multiple of a flicker cycle plus half a flicker cycle. That is, D = (K + 1 / 2) × Tf, where K is an integer and can be 0. In order to reduce the ghosting effect caused by summing and averaging the integrated brightness values of two images with different time intervals, it is usually necessary to minimize the offset D, so K is set to 0.
[0093] To eliminate the flicker effect in HDR images, it is possible to directly apply multiple images with different exposure times. For example, if the HDR image is based on three different exposure times, it is usually necessary to capture a set of triplets of images with short, medium, and long exposure times.
[0094] If the image sensor cannot capture 6 images per frame, you can capture images with short, medium and long exposure times in two consecutive frames, with a time interval of (K+1 / 2)Tf, but this method increases the risk of ghosting. If the image sensor can capture 4 images per frame and ghosting needs to be avoided, you can generate an HDR image using only two images with different exposure times, that is, capture the two sets of images in the same frame. This method may not be applicable if the image sensor can only capture the standard number of images for HDR images per frame (for example, 3 images).
[0095] Therefore, in order to solve this problem, this embodiment provides the application of flicker compensation in short exposure time and long exposure time. It uses the first compensation image in short exposure time and long exposure time as the "reference image" of this embodiment. In this embodiment, the short exposure time and long exposure time are set to a ratio of 4. In order to achieve the flicker compensation effect, the short exposure time and long exposure of each row of the rolling shutter are time-shifted by half a flicker cycle Tf / 2.
[0096] Methods for obtaining HDR images based on flicker compensation images include:
[0097] S2. Acquire a first compensated image generated under multiple different exposure times; wherein the multiple different exposure times include: a short exposure time for capturing bright details, and a long exposure time for capturing dark details.
[0098] S2 specifically includes:
[0099] S2-1, define a short exposure time, which is used to capture a camera scene with higher brightness;
[0100] S2-2, define a long exposure time, which is used to capture a camera scene with low brightness;
[0101] Specifically, the significance of using a short exposure time to capture areas with higher brightness is to reduce overexposure and adapt to rapidly changing light intensity. Reduce overexposure: In high-brightness scenes, too long an exposure time will allow too much light in the bright area to enter the sensor, resulting in saturation of pixel values and loss of details (i.e., overexposure). Short exposure time can limit the amount of light entering the sensor, preventing overexposure of bright areas, thereby retaining the details of the bright areas. Suitable for rapidly changing light intensity: Because there is already enough light entering the sensor in areas with higher brightness, only a short exposure time is required to record brightness information, avoiding the bright details from being "swamped" by too much light, so short exposure time is more suitable for scenes with high light intensity. The significance of using a long exposure time to capture areas with lower brightness is to increase dark details and accumulated light. Increase dark details: In low-brightness areas, if the exposure time is too short, the sensor will not receive enough light, causing these areas to become dim or lose details (i.e., underexposure). Longer exposure times allow more light to enter the sensor, thereby increasing the brightness of the dark areas and making the details of the dark areas clearer. Accumulated light: The effect of a long exposure time in dark areas is equivalent to giving the sensor more time to "capture" light. In dark areas, even if the amount of light is low, by increasing the exposure time, you can still obtain enough brightness information to show the details.
[0102] S2-3. Based on the center points of the short exposure time and the long exposure time, the time between the center points is determined as the reference offset. The reference offset is to ensure that the exposure images collected under two different exposure times can be accurately aligned in time. The reference offset is based on the center points of the two exposure times to achieve image alignment, thereby ensuring that images under different exposure times can be aligned and brightness compensated within the same fluctuation period.
[0103] S2-4. Perform secondary exposure on the image sensor of the vehicle-mounted camera within the short exposure time to obtain a short exposure compensated image; wherein the short exposure compensated image represents the detail information of the higher brightness area captured by the vehicle-mounted camera (i.e., bright details), and retains the high-brightness area details in the scene after removing the periodic fluctuation of the light source.
[0104] S2-5, starting from the center point of the short exposure time, determining the starting point of the long exposure time according to the reference offset;
[0105] S2-6. From the starting point of the long exposure time, perform a second exposure on the image sensor of the vehicle-mounted camera to obtain a long exposure compensation image; wherein the long exposure compensation image represents the detail information of the lower brightness area captured by the vehicle-mounted camera (i.e., dark details), and retains the dark area details in the scene after removing the periodic fluctuation of the light source.
[0106] How to obtain HDR images based on flicker compensation images, including
[0107] S3. Perform brightness-weighted amplification on the first compensated images generated at multiple different exposure times to obtain a second compensated image; wherein the second compensated image is used to represent an HDR image that achieves a balance between bright details and dark details after offsetting periodic fluctuations of the light source.
[0108] S3 specifically includes:
[0109] S3-1, determining a ratio of a long exposure time to a short exposure time according to the exposure time corresponding to each first compensated image;
[0110] S3-2, using the ratio, weightedly amplifying the brightness value of the short exposure compensation image to obtain a short exposure weighted image;
[0111] S3-3, adding the brightness values of the short-exposure weighted image and the long-exposure compensated image to determine a second compensated brightness value;
[0112] The expression for determining the second compensation brightness value is:
[0113] L C2 Indicates the second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensation image;
[0114] S3-4. Generate a second compensated image according to the second compensated brightness value.
[0115] Of course, multiplying the integrated brightness value of the short exposure image by 4 can ensure that some information is not lost, and more details can be retained by increasing the number of multiplication bits. It helps to maintain the details of the bright part of the image, but it should be noted that as the exposure time increases, the details of the highlight area may be lost to a certain extent. For the details of the dark part of the image, a longer exposure time can be used to better present them.
[0116] Embodiment 3: The technical solution of Embodiment 3 is different from that of Embodiment 1 and Embodiment 2 in that a second implementation method of obtaining a first compensated image at multiple different exposure times in an HDR image with flicker compensation and performing brightness weighted amplification is disclosed. The second implementation method includes:
[0117] D3-1, calculating the gradient values of the short exposure compensation image and the long exposure compensation image, and defining them as brightness weighting coefficients;
[0118] The expression for calculating the gradient value of the short exposure compensation image and the long exposure compensation image is:
[0119]
[0120] G S Represents the gradient value of the short exposure compensation image, which is used to characterize the changes in bright details;
[0121] G L Indicates the gradient value of the long exposure compensation image, which is used to characterize the changes in dark details;
[0122] and Respectively represent the absolute values of the time change rates of the brightness values of the short exposure compensation image and the long exposure compensation image;
[0123] D3-2, determining brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image according to the gradient values of the short exposure compensation image and the long exposure compensation image;
[0124] The expression of brightness weighting coefficient is:
[0125]
[0126] W S Represents the weight coefficient of the short exposure compensation image, W L represents the weight coefficient of the long exposure compensation image,
[0127] D3-3, determining a second compensation brightness value according to the brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image; L C2 =w S ·L S +w L ·L L ;
[0128] L C2 The second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensation image;
[0129] D3-4. Generate a second compensated image according to the second compensated brightness value.
[0130] Specifically, although weighted averaging is simpler in implementation and helps to simplify the implementation steps; however, it cannot take into account the details of bright and dark areas well, especially in scenes where the details of bright and dark areas are unevenly distributed. By introducing gradient information to adjust the weights, the weights can be adjusted more flexibly according to the detail requirements of different areas. Gradient information directly reflects the rate and amplitude of change of image brightness values, that is, the richness of image details. A higher gradient means that the image has richer details in this area. Therefore, associating the weight coefficient with the gradient information can make the weight distribution of bright and dark areas more accurate, ensuring that the details are better preserved and balanced during the HDR image synthesis process.
[0131] The second compensation brightness value is generated by weighting the gradient information, which significantly improves the effect of HDR images and makes the image more superior in detail balance between bright and dark parts. At the same time, the weight distribution based on gradient information can effectively reduce the artifact effect, enhance the detail performance of complex scenes, and adapt to different lighting conditions, providing higher quality anti-flicker image output for vehicle-mounted cameras. This method improves the system's ability to capture and present details, making the generated images clearer and more natural.
[0132] In summary, the embodiment of the present invention compensates for the periodic fluctuation of the light source through two exposures (the first exposure and the second exposure delayed by half a flicker cycle), so that the brightness value obtained by the vehicle camera is more stable and the light and dark stripes in the image are reduced. The compensated brightness value obtained by averaging the results of the two exposures effectively offsets the impact of periodic brightness fluctuations. It can keep the exposure brightness of each row of the rolling shutter consistent, reduce the impact of flicker on the image, and thus provide an image with stable brightness.
[0133] Furthermore, the embodiments of the present invention make the bright details and dark details richer through different brightness compensation of short exposure time and long exposure time. Among them, the image gradient weighting method directly reflects the brightness change rate of the short exposure compensation image and the long exposure compensation image, which can better highlight the richness of image details. After gradient weighting, both the bright and dark areas of the image can obtain appropriate details, further improving the expressiveness of the HDR image, making the final image more visually appealing and detailed.
[0134] In addition, in this embodiment, the camera includes a light source periodic fluctuation detection module and an exposure control module; the light source periodic fluctuation detection module is used to obtain the sine wave period of the light source and determine the peak and trough. , providing a reference for subsequent exposure time setting; the camera also includes a weighting module; the weighting module is used to amplify the brightness of the short exposure compensation image according to the ratio of the long exposure time to the short exposure time, and add the amplified short exposure compensation image to the long exposure compensation image to generate an HDR image. The camera adapts to different light source frequencies to adjust the exposure time, including frequencies of 50Hz and 60Hz.
[0135] The above embodiments can be implemented in whole or in part by software, hardware, firmware or other arbitrary combinations. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
[0136] The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0137] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division of a waterway underwater terrain change analysis system and method. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A vehicle camera anti-flicker method, applied to a vehicle camera, characterized in that: The anti-flicker method comprises: S1. Acquire a first compensation image, where the first compensation image is used to represent a single exposure image after the periodic fluctuation of the light source is offset; S2, acquiring the first compensated image generated under multiple different exposure times; wherein the multiple different exposure times include: a short exposure time for capturing bright details, and a long exposure time for capturing dark details S3. Perform brightness-weighted amplification on the first compensated images generated at multiple different exposure times to obtain a second compensated image; wherein the second compensated image is used to represent an HDR image that achieves a balance between bright details and dark details after offsetting periodic fluctuations of the light source.
2. The anti-flicker method for a vehicle-mounted camera according to claim 1, characterized in that: The step of acquiring a first compensation image comprises: S1-1, detecting the periodic fluctuation of the light source, and graphing the periodic fluctuation to obtain a sinusoidal wave curve of the light source; S1-2, identify the peaks and troughs on the sine wave curve and determine the sine wave period; S1-3. Perform secondary exposure on the image sensor of the vehicle-mounted camera according to the sinusoidal wave period of the light source to obtain the first compensated image.
3. The anti-flicker method of a vehicle-mounted camera according to claim 1, characterized in that: The method of performing secondary exposure on the image sensor of the vehicle-mounted camera comprises: S1-3-1. Start the first exposure at any time point within the sine wave period to obtain a first exposure image; wherein the first exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a first integrated brightness value, and generating the first exposure image based on the first integrated brightness value; The expression for generating the first integrated brightness value is: L T1 Indicates that at the first exposure time T ia P(t) represents the instantaneous brightness value of the light source at time t. ia represents the duration of the first exposure, t0 is the start time of the first exposure, ∫ represents the integral operation, that is, P(t) is in the interval [t0, t0+T ia ], dt represents the small time increment used in the integration operation, which is used to integrate the time t; S1-3-2, starting a second exposure after half a sine wave cycle after the first exposure to obtain a second exposure image; wherein the second exposure is characterized by integrating the sine wave brightness of the light source within the exposure time to generate a second integrated brightness value, and generating the second exposure image based on the second integrated brightness value; The expression for generating the second integrated brightness value is: L T2 Indicates that at the second exposure time T ia The accumulated brightness value within Indicates the start time of the second exposure, which is delayed by half a flash cycle relative to the start time of the first exposure S1-3-3, summing and averaging the brightness values of the first exposure image and the second exposure image to determine a first compensation brightness value; The expression of the first compensation brightness value is: L C1 represents the first compensation brightness value; S1-3-4. Generate the first compensated image according to the first compensated brightness value.
4. The anti-flicker method for a vehicle-mounted camera according to claim 1, characterized in that: The acquiring the first compensated images generated under a plurality of different exposure times comprises: S2-1, defining a short exposure time, where the short exposure time is used to capture a camera scene with higher brightness; S2-2, defining a long exposure time, where the long exposure time is used to capture a camera scene with lower brightness; S2-3, based on the center points of the short exposure time and the long exposure time, determining the time between the center points as a reference offset; S2-4, performing secondary exposure on the image sensor of the vehicle-mounted camera within the short exposure time to obtain a short exposure compensated image; S2-5, starting from the center point of the short exposure time, determining the starting point of the long exposure time according to the reference offset; S2-6, from the starting point of the long exposure time, performing secondary exposure on the image sensor of the vehicle-mounted camera to obtain a long exposure compensated image.
5. The anti-flicker method of a vehicle-mounted camera according to claim 4, characterized in that: According to the first compensated images generated at multiple different exposure times, brightness weighted amplification is performed on them to obtain a second compensated image, including: S3-1, determining a ratio of a long exposure time to a short exposure time according to the exposure time corresponding to each first compensated image; S3-2, using the ratio, weightedly amplifying the brightness value of the short exposure compensation image to obtain a short exposure weighted image; S3-3, adding the brightness values of the short-exposure weighted image and the long-exposure compensated image to determine a second compensated brightness value; S3-4. Generate the second compensated image according to the second compensated brightness value. The expression for determining the second compensation brightness value is: L C2 Indicates the second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensated image.
6. The anti-flickering method of a vehicle-mounted camera according to claim 5, characterized in that: According to the first compensated images generated at multiple different exposure times, brightness weighted amplification is performed on them to obtain a second compensated image, including: D3-1, calculating the gradient values of the short exposure compensation image and the long exposure compensation image, and defining the gradient values as brightness weighting coefficients; The expression for calculating the gradient value of the short exposure compensation image and the long exposure compensation image is: G S Represents the gradient value of the short exposure compensation image, which is used to characterize the changes in bright details; G L Indicates the gradient value of the long exposure compensation image, which is used to characterize the changes in dark details; and Respectively represent the absolute values of the time change rates of the brightness values of the short exposure compensation image and the long exposure compensation image; D3-2, determining brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image according to the gradient values of the short exposure compensation image and the long exposure compensation image; The expression of the brightness weighting coefficient is: In S +in L =1; w S Represents the weight coefficient of the short exposure compensation image, w L represents the weight coefficient of the long exposure compensation image, D3-3, determining a second compensation brightness value according to brightness weighting coefficients of the short exposure compensation image and the long exposure compensation image; L C2 =w S ·L S +w L ·L L ; The L C2 The second compensation brightness value, L S Indicates the brightness value of the short exposure compensation image, L L Indicates the brightness value of the long exposure compensation image; D3-4. Generate the second compensated image according to the second compensated brightness value.
7. The anti-flickering method of a vehicle-mounted camera according to claim 2, characterized in that: The camera comprises a light source periodic fluctuation detection module and an exposure control module; the light source periodic fluctuation detection module is used to obtain the sine wave period of the light source and determine the wave peaks and wave troughs.
8. The anti-flickering method of a vehicle-mounted camera according to claim 7, characterized in that: The camera also includes a weighting module; the weighting module is used to amplify the brightness of the short exposure compensation image according to the ratio of the long exposure time to the short exposure time, and add the amplified short exposure compensation image to the long exposure compensation image to generate the HDR image.
9. The anti-flicker method for a vehicle-mounted camera according to claim 1, characterized in that: The camera can adapt to different light source frequencies to adjust the exposure time.
Citation Information
Patent Citations
Camera shooting device anti-flicker method and system, camera shooting device and control method of camera shooting device
CN111935366A