Video color distortion reduction method and device for digital camera, and storage medium
By identifying and analyzing the white and black reference objects in the video taken by digital cameras, the accurate light source color RGB parameters are calculated, the influence of light source color is eliminated and the light intensity is adjusted, and the color distortion of digital cameras is solved and the video color is realized. Effective restore.
Patent Information
- Application Number
- CN202411661458.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-11
AI Technical Summary
Digital cameras are prone to color distortion when shooting videos under different lighting conditions, affecting the authenticity and quality of the video.
By identifying the white and black reference objects in the first and last frames of the video, recording their RGB parameters, and obtaining accurate light source color RGB parameters through normalized data calculations, eliminating the color rendering brought by the light source color, and adjusting the light intensity to restore the video color.
It effectively eliminates the impact of light source color on the video, restores the true color of the video, and is suitable for scenes with different light intensities and color temperatures, improving the color accuracy and sense of layering of the video.
Smart Images

Figure CN119421060A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing of cameras, and in particular to a method, device and storage medium for restoring video color distortion of a digital camera. Background Art
[0002] With the widespread application of digital cameras in many fields such as security monitoring, video conferencing, and live webcasting, the importance of video quality has become increasingly prominent. However, due to various factors, the video captured by digital cameras may have color distortion, which seriously affects the authenticity of the video content; the factors that affect the color distortion of the video captured by digital cameras include the following three points:
[0003] (1) Light intensity: When the light intensity is too weak, the digital camera will automatically increase the sensitivity in order to obtain a clear enough image. This may cause more noise in the image, and the color will become darker or yellower, or even reduce the recognition of certain colors, resulting in color distortion. For example, when shooting in a dim indoor environment, the overall tone of the video image is often darker and the colors are not bright enough.
[0004] On the contrary, if the light intensity is too strong, such as shooting under strong direct sunlight, overexposure is likely to occur. Overexposure will cause the brightness of some areas in the picture to exceed the range that the camera can normally record, resulting in the loss of color information in these areas, presenting a pale effect, which seriously undermines the authenticity and layering of the colors.
[0005] (2) Color temperature differences. Different light sources have different color temperatures. For example, the color temperature of light emitted by incandescent lamps is relatively low, tending towards warm yellow, while the color temperature of fluorescent lamps is relatively high, tending towards cool white. When a digital camera shoots under light sources of different color temperatures, if the appropriate white balance adjustment is not made, the video will have obvious color deviations. For example, a video shot under an incandescent lamp may appear yellowish overall, while a video shot under a fluorescent lamp may appear blue, distorting the original color.
[0006] (3) Illumination angle: Non-uniform illumination angles can also affect video color. When light shines on an object from the side or at a specific angle, different parts of the object's surface receive different light intensities and reflections, which may cause the same object to have inconsistent colors in different areas of the video. For example, if you shoot a sphere with one side well-lit and the other in the shadow, the colors on both sides of the sphere will be significantly different, resulting in a distorted look.
[0007] Therefore, there is an urgent need for a method for restoring video color distortion of a digital camera. Summary of the invention
[0008] In order to solve the above-mentioned technical problems, the present invention provides a method, device and storage medium for restoring video color distortion of a digital camera.
[0009] The technical solution of the present invention is achieved in this way:
[0010] A method for restoring color distortion of a video of a digital camera comprises the following steps:
[0011] S1, capturing the first frame and the last frame of the video recorded by the camera, and saving them in the video image processing module respectively;
[0012] S2, identifying the first frame and the last frame of the image in the video image processing module, obtaining the white reference object in the image, and recording the RGB parameters of the reference object;
[0013] S3, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as white, and recording the light source color;
[0014] S4, identifying the first frame and the last frame of the image in the video image processing module, obtaining the black reference object in the image, and recording the RGB parameters of the reference object;
[0015] S5, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as black, and recording the light source color;
[0016] S6, obtaining accurate RGB parameters of the light source color by using the calculation method of normalized data through the light source color records of step S3 and step S5, and using the RGB parameters to eliminate the color rendering caused by the light source color in the video recorded by the camera to obtain a color restored video;
[0017] S7, according to the color restored video obtained in step S6, adjusting the camera recording illumination intensity in the corresponding time period through the scene illumination intensity template preset by the video image processing module.
[0018] Preferably, the step S2 further comprises the following sub-steps:
[0019] S21, loading the first frame of image saved in the video image processing module, and using the image recognition algorithm to fully scan the image to identify a white reference object in the image, where the white reference object is an object known to be white in the scene;
[0020] S22, for the identified white reference object, accurately obtain its RGB parameter value in the RGB color space through an image color analysis tool;
[0021] S23, recording the acquired RGB parameter values of the white reference object in an array form, and storing them together with the relevant identification information of the image in a temporary data storage area in the video image processing module for comparison and analysis in subsequent steps; S24, repeating the above steps S21-S23, and performing the same white reference object identification, RGB parameter acquisition and recording operations on the last frame of the image.
[0022] Preferably, the step S3 further comprises the following sub-steps:
[0023] S31, in the video image processing module, set the RGB parameter value of the standard white color, in the RGB color space, the RGB parameter of the standard white color is set to (255, 255, 255), read the RGB parameter value of the white reference object in the first frame image from the temporary data storage area, and compare and analyze it with the set RGB parameter value of the standard white color; by calculating the difference vector between the two, that is, respectively calculating the difference of the three channels of R, G, and B, preliminarily judge the direction and degree of influence of the current light source color on the white reference object;
[0024] S32, based on the above difference analysis results and in combination with a pre-established light source color judgment model, preliminarily identifying the approximate type and characteristics of the current light source color;
[0025] S33, recording the preliminarily identified current light source color information in a standardized data format, and storing it in another temporary data storage area in the video image processing module in association with the relevant identification information of the first frame image, so as to facilitate further comprehensive analysis in subsequent steps;
[0026] S34, repeating the above steps S31-S33, performing a preliminary light source color recognition operation based on the white reference object on the last frame of image, obtaining a preliminary light source color recognition result corresponding to the last frame of image, and also recording and storing it. Preferably, in the step S2, obtaining the white reference object includes specifying an object in the image as a white reference object, or identifying the object in the image through an image recognition module, identifying the object type, and determining that the color of the object of this type is white.
[0027] Preferably, in step S4, obtaining a black reference object includes designating an object in the image as a black reference object, or identifying the object in the image through an image recognition module, identifying the type of the object, and determining that the color of the object of this type is black.
[0028] Preferably, in step S2 or step S4, the reference object may use three primary colors as reference colors, and the reference object and the RGB parameters of the reference object color may be specified as the reference color.
[0029] A video color distortion restoration device for a digital camera comprises at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the video color distortion restoration method of the digital camera is implemented.
[0030] A storage medium stores computer program instructions, wherein the computer program instructions are executed by a processor to implement the above-mentioned method for restoring video color distortion of a digital camera.
[0031] The present invention solves the problem of color distortion in videos shot by digital cameras due to lighting reasons. The present invention can accurately identify the color of the light source by analyzing the RGB parameters of the white and black reference objects in the first and last frames of the video, combining normalization and other calculations, effectively eliminating the color rendering caused by it, and restoring the true color. For a variety of scene mode settings with different indoor and outdoor light intensities and color temperatures, the light source color recognition range and light intensity parameters can be adjusted according to the actual scene characteristics to adapt to diverse shooting environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The present invention is a schematic diagram of a method for restoring video color distortion of a digital camera. DETAILED DESCRIPTION
[0033] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.
[0034] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "the", and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0035] like Figure 1 As shown, the present invention provides a method for restoring video color distortion of a digital camera, comprising the following steps:
[0036] S1, capturing the first frame and the last frame of the video recorded by the camera, and saving them in the video image processing module respectively;
[0037] S2, identifying the first frame and the last frame of the image in the video image processing module, obtaining the white reference object in the image, and recording the RGB parameters of the reference object;
[0038] S3, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as white, and recording the light source color;
[0039] S4, identifying the first frame and the last frame of the image in the video image processing module, obtaining the black reference object in the image, and recording the RGB parameters of the reference object;
[0040] S5, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as black, and recording the light source color;
[0041] S6, obtaining accurate RGB parameters of the light source color by using the calculation method of normalized data through the light source color records of step S3 and step S5, and using the RGB parameters to eliminate the color rendering caused by the light source color in the video recorded by the camera to obtain a color restored video;
[0042] S7, according to the color restored video obtained in step S6, adjusting the camera recording illumination intensity in the corresponding time period through the scene illumination intensity template preset by the video image processing module.
[0043] Preferably, the step S2 further comprises the following sub-steps:
[0044] S21, loading the first frame of the saved image into the video image processing module, and using the image recognition algorithm to fully scan the image to identify the white reference object in the image, where the white reference object is an object known to be white in the scene, such as a white wall, white paper, and the image has sufficient area and clarity to accurately obtain its color parameters;
[0045] S22, for the identified white reference object, accurately obtain its RGB parameter value in the RGB color space through an image color analysis tool; when obtaining the parameters, sampling and analysis should be performed on different areas of the reference object to obtain more accurate and average RGB parameter values to avoid inaccurate parameters due to local color differences;
[0046] S23, recording the acquired RGB parameter values of the white reference object in an array form, and storing them together with the relevant identification information of the image in a temporary data storage area in the video image processing module for comparison and analysis in subsequent steps; S24, repeating the above steps S21-S23, performing the same white reference object identification, RGB parameter acquisition and recording operations on the last frame of the image, to ensure that the processing of the first and last frame images of the video is consistent and comprehensive.
[0047] Preferably, the step S3 further comprises the following sub-steps:
[0048] S31, in the video image processing module, set the RGB parameter value of the standard white color, in the RGB color space, the RGB parameter of the standard white color is set to (255, 255, 255), read the RGB parameter value of the white reference object in the first frame image from the temporary data storage area, and compare and analyze it with the set RGB parameter value of the standard white color; by calculating the difference vector between the two, that is, respectively calculating the difference of the three channels of R, G, and B, preliminarily judge the direction and degree of influence of the current light source color on the white reference object;
[0049] For example, if the RGB parameter value of a white reference object is (240, 245, 248), compared with the standard white, the R channel difference is -15, the G channel difference is -10, and the B channel difference is -7. This indicates that the current light source may make the white object appear slightly darker and the color tends to a certain hue;
[0050] S32, based on the above difference analysis results and in combination with a pre-established light source color judgment model, preliminarily identifying the approximate type and characteristics of the current light source color; for example, based on the difference situation and the model judgment, the current light source may be a warm yellow light with a lower color temperature, or a fluorescent light with a certain color cast;
[0051] S33, recording the preliminarily identified current light source color information in a standardized data format, and storing it in another temporary data storage area in the video image processing module in association with the relevant identification information of the first frame image, so as to facilitate further comprehensive analysis in subsequent steps;
[0052] S34, repeating the above steps S31-S33, and performing a preliminary light source color recognition operation based on a white reference object on the last frame of image, obtaining a preliminary light source color recognition result corresponding to the last frame of image, and also recording and storing it. Preferably, the step S4 further includes the following sub-steps:
[0053] S41, as in step S21, reloading the first frame of image in the video image processing module, and using the same image recognition algorithm to scan the image to identify a black reference object in the image; the black reference object can be an object known to be black in the scene, such as black clothes and black hair, and it is also necessary to ensure that it has sufficient area and clarity in the image;
[0054] S42, accurately obtaining RGB parameter values of the black reference object in the RGB color space through an image color analysis tool; when obtaining the parameters, sampling and analyzing different areas of the reference object are also performed to obtain more accurate and average RGB parameter values;
[0055] S42, recording the acquired RGB parameter values of the black reference object in a specific data format, and storing them together with the relevant identification information of the image in a temporary data storage area in the video image processing module for comparison and analysis in subsequent steps;
[0056] S43, repeating the above steps S41-S42, and performing the same black reference object recognition, RGB parameter acquisition and recording operations on the last frame of image.
[0057] Preferably, the step S5 further comprises the following sub-steps:
[0058] S51, in the video image processing module, set the RGB parameter value of the standard black; in the RGB color space, the RGB parameter of the standard black is usually set to (0, 0, 0), but it can also be fine-tuned according to the actual application scenario and requirements; S52, read the RGB parameter value of the black reference object in the first frame image from the temporary data storage area, and compare and analyze it with the set standard black RGB parameter value; by calculating the difference vector between the two, further determine the direction and degree of influence of the current light source color on the black reference object;
[0059] For example, if the RGB parameter value of a black reference object is (5, 3, 2), compared with the standard black, the R channel difference is 5, the G channel difference is 3, and the B channel difference is 2. This indicates that the current light source may make the black object appear slightly brighter and have a certain color tendency;
[0060] S52, based on the above difference analysis results, combined with the pre-established light source color judgment model, further identify the specific type and characteristics of the current light source color. Since the reflection of the light source color by the black reference object may be different from that of the white reference object, the current light source color can be determined more accurately by combining the analysis results of the two. For example, by combining the analysis of the white reference object and the black reference object, it may be determined that the current light source is a mixed light with a moderate color temperature but a slight color cast. S53, record the further identified current light source color information in a standardized data format, and store it in another temporary data storage area in the video image processing module in association with the relevant identification information of the first frame image, so as to facilitate comprehensive analysis in subsequent steps;
[0061] S54, repeating the above steps S51-S52, further identifying the light source color based on the black reference object for the last frame of image, obtaining the further identification result of the light source color corresponding to the last frame of image, and also recording and storing it. Preferably, the step S6 also includes the following sub-steps:
[0062] S61, in the video image processing module, extracting all information about the light source color from the temporary data storage area that records the preliminary identification results and further identification results of the light source color of the first frame and the last frame of the image, including the difference vector obtained by analyzing the white reference object and the black reference object, the preliminary identified light source color type, and the further identified light source color type;
[0063] S62, using a calculation method for normalized data to comprehensively process all the information about the light source color extracted; the specific calculation method may be to first perform a weighted average on the difference vectors obtained based on the white reference and the black reference to obtain a comprehensive difference vector; then, according to the comprehensive difference vector and the preset standard white and standard black RGB parameter values, calculate the accurate RGB parameter value of the light source color through a formula; for example, the accurate RGB parameter value of the light source color obtained through calculation is (230, 235, 240), which indicates that the current light source color has a certain color cast relative to the standard white;
[0064] S63, using the calculated accurate RGB parameter value of the light source color, perform color restoration processing on the entire video recorded by the camera; the specific operation may be, through the color adjustment algorithm implemented in the video image processing module, performing corresponding operations on the RGB parameter value of each pixel of each frame image in the video and the accurate RGB parameter value of the light source color, so as to eliminate the color rendering caused by the light source color and obtain a color restored video; when performing color adjustment, attention should be paid to uniformly processing pixels in different areas to avoid local color unevenness.
[0065] Preferably, the step S7 further comprises the following sub-steps:
[0066] S71, in the video image processing module, presetting a plurality of scene illumination intensity templates; these templates are obtained by analyzing and summarizing a large number of video data of different scenes and different illumination intensities, and each template corresponds to a typical scene illumination intensity condition, such as an indoor weak light scene, an outdoor strong light scene, and a cloudy scene;
[0067] S71, according to the color restoration video obtained in step S6, using the scene recognition algorithm in the video image processing module, identifying the scene in the video to determine which preset scene illumination intensity template it belongs to;
[0068] For example, the scene recognition algorithm determines that the scene in the video corresponds to the indoor low-light scene template;
[0069] S72, once the scene illumination intensity template to which the video belongs is determined, corresponding illumination intensity adjustment parameters are extracted from the template; the adjustment parameters include adjustment values of parameters related to camera sensitivity, exposure time and illumination intensity; for example, for an indoor low-light scene template, possible adjustment parameters are increasing the sensitivity to ISO 800 and extending the exposure time to 1 / 30 second;
[0070] S73, according to the extracted light intensity adjustment parameters, adjust the light intensity recorded by the camera in the corresponding time period; the specific operation may be to set the parameters of the camera's sensitivity and exposure time to corresponding adjustment values by sending a control instruction to the camera (which can be achieved through a communication interface established with the camera), so that in the subsequent recording process, it is possible to more accurately capture the real color information according to the actual light intensity of the current scene, thereby reducing color distortion caused by inappropriate light intensity.
[0071] Preferably, in step S2, obtaining a white reference object includes designating an object in the image as a white reference object, or identifying the object in the image through an image recognition module, identifying the type of the object, and determining that the color of the object of this type is white.
[0072] Preferably, in step S4, obtaining a black reference object includes designating an object in the image as a black reference object, or identifying the object in the image through an image recognition module, identifying the type of the object, and determining that the color of the object of this type is black.
[0073] Preferably, in step S2 or step S4, the reference object may use three primary colors as reference colors, and the reference object and the RGB parameters of the reference object color may be specified as the reference color.
[0074] Preferably, the step S1 further comprises the following steps:
[0075] S101, the camera pre-records a video, and a reference object is placed in the camera shooting environment, where the reference object is a preset RGB color parameter;
[0076] S102, pre-recording video for 24 hours, recording and saving the video, and recording the current lighting environment through the sensor, including color temperature, light intensity and shadow area within 24 hours;
[0077] S103, setting a standard scene with a 4-hour interval and a set of 6 standard scenes with time intervals according to the pre-recorded video, the lighting environment and the reference object;
[0078] Preferably, in step S7, the plurality of scene illumination intensity templates are preset, and each illumination intensity template is a set of 6 standard scenes separated by time periods.
[0079] Preferably, the preliminary identification of the light source color based on the white reference object,
[0080] (1) Calculate the RGB difference vector between the white reference object and the standard white. Suppose the RGB parameter value of the white reference object is (R w , G w , B w ), the RGB parameter value of the standard white is set to, then the RGB difference vector Δ white The calculation formula is: white =(R w -255, G w -255, Bw -255)
[0081] Preferably, the preliminary judgment of the influence of the light source color on the white reference object can be based on the white reference object. In order to preliminarily judge the influence of the light source color on the white reference object, the sum of the absolute values of the differences of each channel Dwhite can be calculated, and the formula is as follows:
[0082] D white =|R w -255|+|G w -255|+|B w -255|; by D white The value of can give a rough idea of the degree to which the current light source causes white objects to deviate from the standard white. The larger the value, the more obvious the deviation.
[0083] (2) Calculate the RGB difference vector between the black reference object and the standard black. Suppose the RGB parameter value of the black reference object is (R b , G b , B b ), the RGB parameter value of standard black is set to, then the RGB difference vector Δ black The calculation formula is: black =(R b -0, G b -0, B b -0)
[0084] Preferably, the preliminary judgment of the influence of the light source color on the black reference object can be based on the black reference object. In order to preliminarily judge the influence of the light source color on the black reference object, the sum of the absolute values of the differences of each channel Dblack can be calculated, and the formula is as follows: D black =|R b -0|+|G b -0|+|B b -0|;
[0085] D black The larger the value is, the more obvious the current light source makes the black object deviate from the standard black;
[0086] (3) Acquisition of accurate light source color RBG parameters and video color restoration:
[0087] Calculate the comprehensive difference vector, assuming that the RGB difference vector obtained based on the white reference is Δ white =(R w-diff , G w-diff , B w-diff ), whose weight W white Set to 0.4-0.6, the following formula is set to 0.4; the RGB difference vector obtained based on the black reference is Δ black =(R b-diff , G b-diff , B b-diff ), whose weight W black Set to 0.4-0.6, and set the following formula to 0.6.
[0088] Then the calculation formula of the comprehensive difference vector Δcombined is:
[0089] Δ combined =w white ×Δ white +w black ×Δ black
[0090] =(0.6×R w-diff +0.4×R b-diff , 0.6×G w-diff +0.4×G b-diff , 0.6×B w-diff +0.4×B b-diff )
[0091] Calculate the accurate RGB parameter value of the light source color. Assume that the RGB parameter value of standard white is (255, 255, 255), and the RGB parameter value of standard black is (0, 0, 0). The comprehensive difference vector is:
[0092] Δ combined =(R combined-diff , G combined-diff , B combined-diff ).
[0093] The accurate RGB parameter value of the light source color (R source , G source , B source ) is calculated as:
[0094] R source =255-R combined-diff
[0095] G source =255-Gcombined-diff
[0096] B source =255-B combined-diff
[0097] Video color restoration calculation, assuming that the original RGB parameter value of a pixel in a certain frame of the video is (R original , G original , B original ), the accurate RGB parameter value of the light source color is (R source , G source , B source ), then the RGB parameter value of the pixel after color restoration (R restored , G restored , B restored ) is calculated as:
[0098] R restored =R original -R source
[0099] G restored =G original -G source
[0100] B restored =B original -B source
[0101] Preferably, the scene mode is as follows:
[0102] (1) Indoor low-light scene mode
[0103] Scene features:
[0104] The light intensity is low, the light distribution is relatively uneven, and there may be many shadow areas. Common light sources include incandescent lamps, table lamps, etc., which generally have a low color temperature and a warm overall tone.
[0105] Due to insufficient light, the camera may automatically increase the sensitivity, resulting in increased picture noise, relatively low color saturation and contrast, and prone to yellowish and dark color distortion.
[0106] Light source color recognition related settings:
[0107] When identifying a white reference object, since white objects may appear dark and yellowish in low light environments, the allowable RGB difference range can be appropriately relaxed when comparing the RGB parameters of the white reference object with the standard white parameters. For example, the standard white is (255, 255, 255). In an indoor low-light scene, when the sum of the absolute values of the differences between the RGB parameters of the white reference object and the standard white parameters in each channel (as calculated in the previous steps) is less than or equal to 30, it can still be considered to be within a reasonable white deviation range (this value can be adjusted based on actual testing and experience).
[0108] For black reference objects, due to the influence of low light environment, black objects may not be absolutely black, but have a certain grayscale. Therefore, when comparing the RGB parameters of the black reference object with the standard black parameters, the sum of the absolute values of the RGB differences (calculated in the previous step) is allowed to be less than or equal to 10, which is considered to be the normal black deviation range in this scene (adjustable).
[0109] Light intensity adjustment parameter settings:
[0110] Sensitivity (1ISO): Generally, the ISO can be increased to between 800-1600, and the specific value can be fine-tuned according to the brightness and noise of the actual picture during shooting. A higher ISO can increase the camera's sensitivity to light and make the picture brighter, but it will also bring more noise, so a balance needs to be struck between brightness and image quality.
[0111] Exposure time (T): You can extend the exposure time appropriately, such as setting it between 1 / 30 second and 1 / 15 second. Extending the exposure time allows more light to enter the camera sensor, further improving the brightness of the image, but too long an exposure time may cause the image to be blurred due to camera shake or object movement, so you need to control it according to the actual situation.
[0112] White balance: Since the color temperature of indoor low-light scenes is lower, you can set the white balance mode to "tungsten light" or manually adjust the color temperature to between 2800K-3200K to make the picture color closer to the real situation and reduce color distortion caused by color temperature differences.
[0113] (2) Indoor bright light scene mode
[0114] Scene features:
[0115] When the light intensity is high, there may be areas with direct light or strong reflections, which may easily lead to overexposure. The light source is usually a strong light bulb, large lamp, etc. The color temperature may vary depending on the type of lamp, but the overall light is brighter and the color is more vivid. In a strong light environment, some areas of the picture may lose color details due to overexposure, and the contrast may be too high, causing the dark areas to appear too dark, affecting the overall color performance and layering.
[0116] Light source color recognition related settings:
[0117] For white reference objects, since strong light may make white objects look brighter or even overexposed, when comparing their RGB parameters with those of standard white, the sum of the absolute values of the RGB differences allowed (Δ white ) is less than or equal to 20, which can be considered as a reasonable white deviation range (which can be adjusted according to actual conditions). The range here is narrower than that of indoor low-light scenes, because white objects under strong light should be closer to standard white.
[0118] For black reference objects, strong light may cause the black object to show some reflection in the picture, making it look not absolutely black. Therefore, when comparing its RGB parameters with the standard black parameters, the sum of the absolute values of the allowed RGB differences (Δ black ) is less than or equal to 8, which is considered as the normal black deviation range (adjustable).
[0119] Light intensity adjustment parameter settings:
[0120] Sensitivity (ISO): The ISO value can be lowered appropriately, such as setting it between 100-200, to reduce the problem of excessive noise in the picture caused by excessive sensitivity. In a strong light environment, there is sufficient light and there is no need for excessive sensitivity to increase brightness.
[0121] Exposure time (T): Shorten the exposure time, which can be set between 1 / 250 second and 1 / 125 second to avoid overexposure caused by excessive light, so that the picture can better capture color details, while also reducing the problem of picture blur caused by too long exposure time.
[0122] White balance: Make corresponding adjustments based on the color temperature of the actual light source. If it is an ordinary white strong light bulb, you can set the white balance mode to "auto" or manually adjust the color temperature to between 5000K-5500K; if it is a special strong light fixture with a certain color cast, such as a yellow spotlight, you need to make a more precise manual white balance adjustment based on its actual color temperature to ensure accurate color in the picture.
[0123] (3) Outdoor sunny scene mode
[0124] Scene features:
[0125] The light intensity is very high, the sun is direct and the light distribution is relatively even. When the sky is clear and cloudless, the color saturation is high and the overall picture is bright and clear. However, strong sunlight may also cause overexposure of highlights and over-darkening of shadows, and the color temperature of sunlight will change at different times.
[0126] In this scene, color vividness and contrast are usually high, but attention needs to be paid to color processing in highlight and shadow areas to avoid color distortion.
[0127] Light source color recognition related settings:
[0128] For a white reference object, in an outdoor sunny scene, the white object should be close to the standard white. Therefore, when comparing its RGB parameters with the standard white parameters, the sum of the absolute values of the allowed RGB differences (Δ white ) is less than or equal to 15, it can be considered as a reasonable white deviation range (can be adjusted according to actual conditions).
[0129] For black reference objects, although the sunlight is strong, black objects should usually appear pure black in outdoor sunny environment. Therefore, when comparing its RGB parameters with the standard black parameters, the sum of the absolute values of the allowed RGB differences (Δ black ) is less than or equal to 6, which is considered as the normal black deviation range (adjustable).
[0130] Light intensity adjustment parameter settings:
[0131] Sensitivity (ISO): Generally set between 100-400, and fine-tune according to the specific shooting time (such as morning, noon, afternoon) and light intensity. For example, when the sunlight is strongest at noon, the ISO can be set to around 100; when the sunlight is relatively weak in the morning or evening, the ISO value can be appropriately increased, but not too high to avoid excessive noise. Exposure time (T): It can be set between 1 / 500 second and 1 / 250 second, and adjusted according to the intensity of sunlight and the movement of the subject. Shorter exposure time helps capture fast-moving objects and can also effectively prevent overexposure. White balance: Adjust according to the color temperature of sunlight in different time periods. In the morning and evening, the color temperature of sunlight is lower, so the white balance mode can be set to "Daylight" or the color temperature can be manually adjusted to between 5000K and 6000K; at noon, the color temperature of sunlight is higher, so the white balance mode can be set to "Sunny" or the color temperature can be manually adjusted to between 6000K and 6500K to ensure that the color of the picture matches the actual scene.
[0132] (4) Outdoor cloudy scene mode
[0133] Scene features:
[0134] The light intensity is relatively weak, the light is soft and uniform, there are no obvious highlights and shadow areas, but the overall tone is dark, the color saturation is relatively low, the color temperature is high, and the picture presents a gray feeling.
[0135] In cloudy conditions, the camera may automatically adjust the sensitivity and exposure time to obtain a sufficiently clear picture, but this may result in less vivid colors and lower contrast, and appropriate adjustments are required to restore the true colors.
[0136] Light source color recognition related settings:
[0137] For white reference objects, since white objects appear slightly darker and cooler than standard white in a cloudy environment, when comparing their RGB parameters with those of standard white, the sum of the absolute values of the RGB differences allowed (Δ white ) is less than or equal to 25, it can be considered as a reasonable white deviation range (can be adjusted according to actual conditions).
[0138] For black reference objects, black objects in cloudy conditions will appear slightly brighter and cooler than standard black. Therefore, when comparing their RGB parameters with those of standard black, the sum of the absolute values of the allowed RGB differences (Δ black ) is less than or equal to 12, which is considered to be the normal black deviation range (adjustable).
[0139] Light intensity adjustment parameter settings:
[0140] Sensitivity (ISO): can be set between 200-800, and fine-tuned according to the degree of cloudy weather (such as light cloudy, moderate cloudy, and heavy cloudy). In light cloudy weather, ISO can be set to around 200; in moderate cloudy weather, ISO can be set to around 400; in heavy cloudy weather, ISO can be set between 600-800 to increase the brightness of the picture, but pay attention to controlling noise.
[0141] Exposure time (T): can be set between 1 / 60 second and 1 / 30 second. Prolong the exposure time appropriately to obtain enough light and make the picture brighter, but also avoid blurry pictures caused by too long exposure time.
[0142] White balance: You can set the white balance mode to "Cloudy" or manually adjust the color temperature to between 7000K-8000K to correct the coldness of the picture caused by the high color temperature on cloudy days, making the picture colors closer to the real situation.
[0143] A video color distortion restoration device for a digital camera comprises at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the video color distortion restoration method of the digital camera is implemented.
[0144] A storage medium stores computer program instructions, wherein the computer program instructions are executed by a processor to implement the above-mentioned method for restoring video color distortion of a digital camera.
[0145] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for restoring video color distortion of a digital camera, characterized in that: The following steps are included: S1, capturing the first frame and the last frame of the video recorded by the camera, and saving them in the video image processing module respectively; S2, identifying the first frame and the last frame of the image in the video image processing module, obtaining the white reference object in the image, and recording the RGB parameters of the reference object; S3, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as white, and recording the light source color; S4, identifying the first frame and the last frame of the image in the video image processing module, obtaining the black reference object in the image, and recording the RGB parameters of the reference object; S5, identifying the current light source color by comparing the RGB parameters of the reference object with the RGB parameters set as black, and recording the light source color; S6, obtaining accurate RGB parameters of the light source color by using the calculation method of normalized data through the light source color records of step S3 and step S5, and using the RGB parameters to eliminate the color rendering caused by the light source color in the video recorded by the camera to obtain a color restored video; S7, according to the color restored video obtained in step S6, adjusting the camera recording illumination intensity in the corresponding time period through the scene illumination intensity template preset by the video image processing module.
2. The method for restoring video color distortion of a digital camera according to claim 1, characterized in that: The step S2 also includes the following sub-steps: S21, loading the first frame of image saved in the video image processing module, and using the image recognition algorithm to fully scan the image to identify a white reference object in the image, where the white reference object is an object known to be white in the scene; S22, for the identified white reference object, accurately obtain its RGB parameter value in the RGB color space through an image color analysis tool; S23, recording the acquired RGB parameter values of the white reference object in an array form, and storing them together with the relevant identification information of the image in a temporary data storage area in the video image processing module for comparison and analysis in subsequent steps; S24, repeating the above steps S21-S23, and performing the same white reference object recognition, RGB parameter acquisition and recording operations on the last frame of image.
3. The method for restoring video color distortion of a digital camera according to claim 1, characterized in that: The step S3 also includes the following sub-steps: S31, in the video image processing module, set the RGB parameter value of the standard white color, in the RGB color space, the RGB parameter of the standard white color is set to (255, 255, 255), read the RGB parameter value of the white reference object in the first frame image from the temporary data storage area, and compare and analyze it with the set RGB parameter value of the standard white color; by calculating the difference vector between the two, that is, respectively calculating the difference of the three channels of R, G, and B, preliminarily judge the direction and degree of influence of the current light source color on the white reference object; S32, based on the above difference analysis results and in combination with a pre-established light source color judgment model, preliminarily identifying the approximate type and characteristics of the current light source color; S33, recording the preliminarily identified current light source color information in a standardized data format, and storing it in another temporary data storage area in the video image processing module in association with the relevant identification information of the first frame image, so as to facilitate further comprehensive analysis in subsequent steps; S34, repeating the above steps S31-S33, and performing a preliminary light source color recognition operation based on a white reference object on the last frame of image, to obtain a preliminary light source color recognition result corresponding to the last frame of image, and also recording and storing it.
4. The method for restoring video color distortion of a digital camera according to claim 1, characterized in that: In the step S2, the obtaining of the white reference object includes designating an object in the image as a white reference object, or identifying the object in the image through an image recognition module, identifying the type of the object, and determining that the color of the object of this type is white.
5. The method for restoring video color distortion of a digital camera according to claim 1, characterized in that: In the step S4, the obtaining of the black reference object includes designating an object in the image as a black reference object, or identifying the object in the image through an image recognition module, identifying the type of the object, and determining that the color of the object of this type is black.
6. The method for restoring video color distortion of a digital camera according to claim 1, characterized in that: In step S2 or step S4, the reference object may use three primary colors as reference colors, and the reference object and the RGB parameters of the reference object color may be specified as the reference color.
7. A video color distortion restoration device for a digital camera, comprising at least one processor, at least one memory, and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method described in any one of claims 1 to 6 is implemented.
8. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.