Photographic device parameter-based photo color restoration method and device and storage medium

By taking a reference photo in the reference environment and calculating the reference LAB value, and combining the difference calculation of the test LAB value, the photography equipment parameters are automatically selected and set, and the problem of insufficient color restoration accuracy in the photography equipment in the prior art under complex lighting conditions is solved, and high-precision color restoration and simplification of user operations are achieved.

CN119697509APending Publication Date: 2025-03-25GUANGZHOU SHANGJING NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411952583.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Existing photography equipment is difficult to achieve high-precision photo color restoration under complex lighting conditions, and users need to manually adjust multiple parameters, which is complex and time-consuming.

Method used

By setting and taking a reference photo in the reference environment, the reference LAB value is calculated, and the difference between the reference LAB value and the test LAB value is calculated. The parameter combination closest to the reference LAB value is selected, and the photography equipment parameters are automatically set to restore the photo color.

Benefits of technology

It significantly improves the accuracy of photo color restoration, reduces the complexity and time-consuming of user manual parameter adjustment, is suitable for a variety of shooting environments, and improves the adaptability and ease of use of photography equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697509A_ABST
    Figure CN119697509A_ABST
Patent Text Reader

Abstract

According to the photo color restoration method based on the parameters of the photographic equipment, after the photographic equipment is placed in a reference environment and set according to the parameters of the reference equipment, a reference photo is shot, and a reference LAB value is obtained from an electronic photo in the reference environment; determining a plurality of photographing equipment parameter combinations of the photographing equipment, and extracting a test LAB value of each photographing equipment parameter combination corresponding to the electronic photo in the actual photographing environment; calculating a difference value between each test LAB value and the reference LAB value, taking the test LAB value with the minimum difference value as a pre-selected LAB value, and taking the pre-selected LAB value as a target LAB value when the difference value corresponding to the pre-selected LAB value is within a preset LAB difference value range; and setting the photographic equipment according to the photographic equipment parameter combination corresponding to the target LAB value so as to restore the color of a photo shot by the photographic equipment in the actual shooting environment. In this way, the color rendition precision of the photo can be remarkably improved under the complex illumination condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of photographic equipment, and in particular to a method, device and storage medium for restoring photo colors based on photographic equipment parameters. Background Art

[0002] With the rapid development of digital photography technology, photographic equipment has been widely used in people's daily lives and professional fields. However, when faced with complex environmental lighting conditions, the color reproduction performance of existing photographic equipment still has significant limitations. In order to cope with different lighting conditions, traditional photographic equipment usually requires users to manually adjust multiple parameters such as aperture, shutter speed, ISO sensitivity and white balance to obtain ideal shooting effects. Although this manual adjustment method can adapt to a variety of shooting needs, it is often difficult for non-professional users to quickly master and apply these parameters, which in turn affects the shooting effect and the accuracy of color reproduction.

[0003] Although traditional self-service photo taking devices provide an automatic photo taking mode, they have obvious defects. First, some devices rely on a semi-enclosed box structure to reduce light interference, which not only takes up a large space, but also limits the applicable scenarios and cannot meet diverse needs. Secondly, when changing the shooting environment, devices without a box structure need to rebuild a professional lighting environment and be debugged by professionals. The operation is cumbersome and time-consuming, and it is difficult for ordinary users to adapt quickly. Finally, the equipment usually uses an automatic photo taking mode. Although it simplifies the operation, it cannot accurately restore the standard color or sample effect of the photo, resulting in insufficient color restoration accuracy and affecting the shooting effect. Therefore, it is difficult for current photographic equipment to achieve high-precision photo color restoration under complex lighting conditions. Summary of the invention

[0004] The purpose of the present application is to solve at least one of the above-mentioned technical defects, especially the technical defect in the prior art that it is difficult to achieve high-precision photo color restoration under complex lighting conditions.

[0005] In a first aspect, the present application provides a method for photo color restoration based on photographic device parameters, the method comprising:

[0006] When it is determined that the photographic device has been placed in the reference environment, the photographic device is set according to the preset reference photographic device parameters, and the set photographic device is triggered to shoot the preset reference photo to obtain an electronic photo corresponding to the reference environment;

[0007] Calculate the average RGB value of the area of ​​interest in the electronic photo corresponding to the reference environment, and convert the average RGB value into a reference LAB value;

[0008] Determine multiple photography equipment parameter combinations of the photography equipment, and extract the test LAB value of each photography equipment parameter combination corresponding to the electronic photo in the actual shooting environment;

[0009] Calculate the difference between each test LAB value and the reference LAB value, and use the test LAB value with the smallest difference as the pre-selected LAB value, and when the difference corresponding to the pre-selected LAB value is within a preset LAB difference range, use the pre-selected LAB value as the target LAB value;

[0010] The photographic device is set according to the photographic device parameter combination corresponding to the target LAB value to restore the color of the photo taken by the photographic device in the actual shooting environment.

[0011] In one embodiment, the step of determining a plurality of combinations of photographic device parameters of a photographic device comprises:

[0012] Among various photographic device parameters of the photographic device, determining key photographic device parameters for modification, the key photographic device parameters including ISO sensitivity, shutter speed, and white balance offset;

[0013] The modifiable range of the value of each key photographic equipment parameter is determined, and the values ​​of each key photographic equipment parameter are arranged and combined according to the modifiable range of the value of each key photographic equipment parameter to obtain a plurality of photographic equipment parameter combinations.

[0014] In one embodiment, before the step of determining the modifiable range of each key imaging device parameter, the method further includes:

[0015] Among various photographic equipment parameters of the photographic equipment, photographic equipment parameters other than the key photographic equipment parameters are used as fixed photographic equipment parameters, and the values ​​of the fixed photographic equipment parameters are kept unchanged.

[0016] In one embodiment, the step of calculating the difference between each test LAB value and the reference LAB value comprises:

[0017] For each test LAB value, the L difference, A difference and B difference between the test LAB value and the reference LAB value are calculated respectively, and the sum of the absolute values ​​of the L difference, the A difference and the B difference is calculated to obtain the difference between the test LAB value and the reference LAB value.

[0018] In one embodiment, when the difference corresponding to the preselected LAB value is within a preset LAB difference range, the step of using the preselected LAB value as the target LAB value includes:

[0019] The L difference, A difference and B difference corresponding to the pre-selected LAB value are compared with the L difference range, A difference range and B difference range in the LAB difference range. If the L difference, A difference and B difference corresponding to the pre-selected LAB value are all within the LAB difference range, the pre-selected LAB value is used as the target LAB value.

[0020] In a second aspect, the present application provides a device for restoring photo colors based on photographic equipment parameters, the device comprising:

[0021] A reference photo shooting module is used to set the photographic device according to preset reference photographic device parameters when it is determined that the photographic device has been placed in the reference environment, and trigger the set photographic device to shoot the preset reference photo to obtain an electronic photo corresponding to the reference environment;

[0022] A reference LAB value determination module is used to calculate the average RGB value of the interest area in the electronic photo corresponding to the reference environment, and convert the average RGB value into a reference LAB value;

[0023] A test LAB value determination module, used to determine a plurality of photographic device parameter combinations of a photographic device, and extract a test LAB value of each photographic device parameter combination corresponding to an electronic photo in an actual shooting environment;

[0024] A target LAB value determination module is used to calculate the difference between each test LAB value and the reference LAB value, and use the test LAB value with the smallest difference as the pre-selected LAB value, and when the difference corresponding to the pre-selected LAB value is within a preset LAB difference range, use the pre-selected LAB value as the target LAB value;

[0025] The photographic device setting module is used to set the photographic device according to the photographic device parameter combination corresponding to the target LAB value, so as to restore the color of the photos taken by the photographic device in the actual shooting environment.

[0026] In one embodiment, the test LAB value determination module includes:

[0027] a key photographic device parameter determination unit, configured to determine, among various photographic device parameters of the photographic device, key photographic device parameters for modification, the key photographic device parameters including ISO sensitivity, shutter speed, and white balance offset;

[0028] The photographic equipment parameter combination determination unit is used to determine the modifiable range of the value of each key photographic equipment parameter, and arrange and combine the values ​​of each key photographic equipment parameter according to the modifiable range of the value of each key photographic equipment parameter to obtain multiple photographic equipment parameter combinations.

[0029] In one embodiment, before the photographic device parameter combination determination unit, the method further includes:

[0030] The fixed photographic equipment parameter determination unit is used to use the photographic equipment parameters other than the key photographic equipment parameters as fixed photographic equipment parameters among various photographic equipment parameters of the photographic equipment, and keep the values ​​of the fixed photographic equipment parameters unchanged.

[0031] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the photo color restoration method based on photographic equipment parameters as described in any of the above embodiments.

[0032] In a fourth aspect, the present application provides an electronic device, comprising: one or more processors, and a memory;

[0033] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the photo color restoration method based on the photography device parameters in any of the above embodiments are performed.

[0034] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0035] In the photo color restoration method, device and storage medium based on photographic equipment parameters provided in the present application, by setting and shooting a reference photo in a reference environment, the reference LAB value is calculated, and by calculating the difference between the reference LAB value and the test LAB value, the parameter combination closest to the reference LAB value can be selected, thereby significantly improving the color restoration accuracy of the photo under complex lighting conditions and meeting the high-precision color restoration requirements; at the same time, the automatic calculation and selection of the photographic equipment parameter combination replaces the traditional manual adjustment method, reduces the user's dependence on professional knowledge and operating experience, reduces the complexity of the user's manual adjustment of parameters, and reduces the time-consuming process of manual adjustment by the user. Compared with traditional self-service photo equipment, this method no longer relies on a semi-enclosed box structure or a professional lighting environment, and does not require professionals to perform tedious equipment debugging, which greatly reduces the space occupied by the equipment and broadens the applicable scenarios. In addition, the method can quickly adapt to and restore standard colors in a variety of shooting environments, improve the adaptability and ease of use of photographic equipment, and thus improve shooting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 A schematic diagram of a process of a method for restoring photo color based on photographic equipment parameters provided in an embodiment of the present application;

[0038] Figure 2 A schematic diagram of the structure of a photo color restoration device based on photographic equipment parameters provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] The present application provides a method for color restoration of photographs based on photographic equipment parameters. The following embodiments are described by taking the method applied to electronic devices as an example. It can be understood that the electronic devices can be various devices with data processing and photographic equipment control functions, including but not limited to self-service photographic equipment, smart phones, digital cameras, tablet computers, photographic drones, etc. Among them, taking a self-service photographic device as an example, the device is provided with a camera with settable parameters, and the shooting program has a built-in algorithm of the above-mentioned method for color restoration of photographs based on photographic equipment parameters, and is equipped with a reference sample according to user needs. The self-service photographic device is moved to an actual shooting environment, such as a photo studio, a certificate processing hall, a shopping mall, a studio, etc. The device is based on the new actual shooting environment and cooperates with the reference sample. The algorithm will automatically calculate and set the camera parameters that can restore the color of the sample, ensuring that the photographed photos restore the effect of the reference sample, which meets the user's needs. This method can not only significantly improve the color restoration accuracy, but also reduce the need for users to frequently debug parameters in different shooting environments, and improve shooting efficiency. This method can be widely used in different shooting needs, such as character ID photos, art photos, e-commerce product photos, food photos, etc., further broadening the application scenarios and adaptability of photographic equipment.

[0042] like Figure 1 As shown, the method may include the following steps:

[0043] S101: When it is determined that the photographic device has been placed in the reference environment, the photographic device is set according to pre-set reference photographic device parameters, and the set photographic device is triggered to shoot a preset reference photo to obtain an electronic photo corresponding to the reference environment.

[0044] Among them, the benchmark environment refers to a preset standard shooting environment. Before setting the preset benchmark photographic equipment parameters, you can restore the default values ​​of each photographic equipment parameter in the photographic equipment. The default values ​​refer to the initial parameters set when the photographic equipment leaves the factory, including aperture, shutter speed, ISO sensitivity, etc. Benchmark photos refer to the best effect samples that meet user needs. For example, ID photos need to meet relevant certificate production standards. Benchmark photographic equipment parameters are a set of specific parameter combinations used to take benchmark photos. These parameters are pre-set and can be parameters obtained through experimental verification or parameters commonly used in the industry to ensure that the shooting results meet the benchmark calibration requirements. Electronic photos refer to digital images taken by photographic equipment.

[0045] In this step, when the electronic device detects that the photographic device has been placed in the reference environment, all photographic device parameters can be restored to factory default values ​​through a control interface, such as an API or hardware button of the photographic device. For example, parameters such as aperture, shutter, ISO, and white balance can be automatically reset to ensure that they are in a standard initial state when shooting begins. The electronic device configures the photographic device according to preset reference photographic device parameters, such as a specific aperture, shutter speed, ISO, white balance, etc. When the photographic device parameters have been set according to the reference photographic device parameters, the electronic device can trigger the camera module to shoot the reference photo through a control instruction to ensure that the electronic photo in the reference environment is taken under predetermined conditions.

[0046] It can be understood that by setting the photographic equipment according to the pre-set reference parameters, it is ensured that each shooting can be carried out under uniform and standard conditions. In this way, the differences and errors of the photographic equipment during the shooting process are eliminated, so that the photographic equipment is in the expected calibration state when taking the reference photo, ensuring that the photographic equipment can output accurate electronic photos in the reference environment, and providing a standardized reference image for subsequent color restoration.

[0047] S102: Calculate the average RGB value of the interest area in the electronic photo corresponding to the reference environment, and convert the average RGB value into a reference LAB value.

[0048] Among them, the LAB color space is a color model based on human eye perception, which contains three values, namely L value, A value and B value. The L value is brightness, the A value is color difference, ranging from green to red, from negative to positive, and the B value is color difference, ranging from blue to yellow, from negative to positive. LAB value can describe color more accurately. The reference LAB value is the standard color value, which usually represents the ideal color under a standard light source. The region of interest is an area in the electronic photo that has a specific meaning or is used for analysis. Representative areas are usually selected, such as an area in a gray card or color card, or an area containing the main subject. It can be understood that if the reference photo is a ID photo, the region of interest of the electronic photo is the face area. The average RGB value is the arithmetic mean of the red (R), green (G), and blue (B) channel values ​​of all pixels in the region of interest, which is used to represent the overall color characteristics of the region.

[0049] In this step, the image recognition algorithm is used to select the region of interest in the reference photo, and the RGB value of each pixel in the region of interest is read. The arithmetic mean of the R, G, and B channels of all pixels in the region of interest is calculated to obtain the average RGB value of the region of interest. The electronic device converts the average RGB value to the LAB value according to the standard formula of the International Commission on Illumination (CIE). For example, it is first converted to linear RGB through gamma correction, then converted to XYZ color space, and finally the LAB value is calculated.

[0050] It can be understood that selecting a region of interest can effectively eliminate the influence of noise and irrelevant background areas, thereby ensuring the stability and accuracy of the calculation results. The average RGB value of the region of interest can effectively represent the color characteristics of the reference photo, and further improve the accuracy of subsequent color restoration through LAB conversion. In addition, by calculating the reference LAB value through electronic photos, it can adapt to a variety of lighting and scene conditions and automatically adjust the shooting parameters.

[0051] S103: Determine a plurality of photographic device parameter combinations of the photographic device, and extract a test LAB value of each photographic device parameter combination corresponding to the electronic photo in the actual shooting environment.

[0052] The parameter combination of the photographic equipment refers to different combinations of multiple parameters, each of which represents a possible setting to adapt to different shooting conditions and requirements. The test LAB value is the LAB color space value of the photo taken under each parameter combination in the actual shooting environment, indicating the actual performance of the photo color.

[0053] In this step, the electronic device can automatically generate multiple photography parameter combinations through algorithms. For example, the device has a built-in parameter combination library, which includes different configurations such as common shutter, ISO sensitivity, white balance, etc., and then selects the applicable parameter combination according to the actual shooting environment, such as light intensity and color temperature. It can also use sensors to collect environmental data in real time and dynamically adjust the generated parameter combination.

[0054] The electronic device applies the combination of photographic device parameters one by one to take an electronic photo, and calculates the LAB value of the electronic photo to obtain a test LAB value. For example, the original color data of the photo is captured by an image sensor, and then the color data is converted from the RGB color space of the electronic photo to the LAB color space through an image processor.

[0055] It is understandable that under complex lighting conditions, different parameter combinations will result in different color performance of photos. By testing the LAB value, the parameter combination closest to the benchmark LAB value can be screened out to adapt to dynamically changing shooting conditions and achieve optimal color reproduction. It also automatically performs large-scale parameter combination tests, eliminating the need for users to manually try one by one, thereby improving photography efficiency.

[0056] S104: Calculate the difference between each test LAB value and the reference LAB value, and use the test LAB value with the smallest difference as the pre-selected LAB value, and when the difference corresponding to the pre-selected LAB value is within a preset LAB difference range, use the pre-selected LAB value as the target LAB value.

[0057] The difference is the difference between the test LAB value and the benchmark LAB value, which is usually measured by calculating the distance in the color space. The smaller the difference, the closer the test LAB value is to the benchmark LAB value. The pre-selected LAB value is the test LAB value with the smallest difference after calculating the difference between all test LAB values ​​and the benchmark LAB value. It is a preliminary screening result. The LAB difference range is a pre-set allowable error range, which indicates the acceptable difference between the test LAB value and the benchmark LAB value. Values ​​outside this range will be considered unqualified.

[0058] In this step, the electronic device can calculate the difference between each test LAB value and the benchmark LAB value through the image processing unit, wherein the difference can be calculated using the Euclidean distance algorithm. Afterwards, the electronic device sorts the calculation results and selects the test LAB value with the smallest difference from the benchmark LAB value as the pre-selected LAB value. Among them, it can be completed by looping through each test value, calculating the difference and comparing in real time. Then, since selecting the LAB with the smallest difference only ensures that the value is closest to the target value, if the smallest difference is still large, the result may be unreliable or unrealistic, so a preset range needs to be set to ensure that the value is within an acceptable error range. Based on this, the electronic device needs to compare the preset LAB difference range with the difference of the pre-selected LAB value. If the difference is within the set range, it is considered that the pre-selected LAB value meets the standard and becomes the target LAB value.

[0059] It can be understood that by calculating the difference between each test LAB value and the reference LAB value, the parameter combination closest to the reference color can be effectively screened out to achieve the best color reproduction effect, and the best color setting can be quickly found in a complex environment, saving the user's adjustment time and energy. At the same time, by setting the LAB difference range, a certain degree of color difference can be tolerated to avoid rejecting good color reproduction results due to very small errors. This not only maintains accuracy, but also ensures that the photographic equipment can give high-quality colors even in imperfect environments.

[0060] S105: Setting the photographic device according to the photographic device parameter combination corresponding to the target LAB value to restore the color of the photo taken by the photographic device in the actual shooting environment.

[0061] In this step, the electronic device reads the combination of photographic device parameters corresponding to the target LAB value, analyzes these parameters, and distributes them to the corresponding control modules, for example, the ISO parameter corresponds to the sensor gain module, and the white balance parameter corresponds to the image processing module. Afterwards, the electronic device controls the specific hardware through firmware to perform parameter adjustments, such as adjusting the photosensitivity of the sensor and the shutter speed.

[0062] It is understandable that the lighting and color conditions of the actual shooting environment are complex and changeable. Directly setting the parameter combination corresponding to the target LAB value of the photographic equipment can accurately adapt to the environmental conditions, thereby achieving real-time and high-precision restoration of colors in a changing environment, and automatically adjusting the parameters according to the target LAB value, reducing the user's understanding and operation requirements of the shooting parameters.

[0063] In the above embodiment, by setting and shooting a reference photo in a reference environment, the reference LAB value is calculated, and by calculating the difference between the reference LAB value and the test LAB value, the parameter combination closest to the reference LAB value can be selected, thereby significantly improving the color reproduction accuracy of the photo under complex lighting conditions and meeting the high-precision color reproduction requirements; at the same time, the automatic calculation and selection of the photographic equipment parameter combination replaces the traditional manual adjustment method, reduces the user's dependence on professional knowledge and operating experience, reduces the complexity of the user's manual adjustment of parameters, and reduces the time-consuming process of manual adjustment by the user. Compared with traditional self-service photo equipment, this method no longer relies on a semi-enclosed box structure or a professional lighting environment, and does not require professionals to perform tedious equipment debugging, which greatly reduces the space occupied by the equipment and broadens the applicable scenarios. In addition, this method can quickly adapt to and restore standard colors in a variety of shooting environments, improve the adaptability and ease of use of photographic equipment, and thus improve shooting efficiency.

[0064] In one embodiment, the step of determining a plurality of photography device parameter combinations of a photography device includes:

[0065] Among various photographic device parameters of the photographic device, determining key photographic device parameters for modification, the key photographic device parameters including ISO sensitivity, shutter speed, and white balance offset;

[0066] The modifiable range of the value of each key photographic equipment parameter is determined, and the values ​​of each key photographic equipment parameter are arranged and combined according to the modifiable range of the value of each key photographic equipment parameter to obtain a plurality of photographic equipment parameter combinations.

[0067] Among them, key photographic equipment parameters refer to the photographic equipment parameters that have a greater impact on image quality and effect during the shooting process, including ISO sensitivity, shutter and white balance offset, etc., which have a direct impact on exposure, image clarity and color accuracy, and are the main parameters for adjusting shooting effects. ISO sensitivity refers to the sensitivity of the camera sensor to light. The higher the ISO value, the stronger the sensitivity. Shutter refers to the shutter speed of the camera, also known as exposure time, which controls the length of time light enters the camera. The slower the shutter speed, the more light the image will capture; the faster the shutter speed, the faster it can freeze fast-moving objects. White balance offset refers to the parameter for adjusting the color temperature of the image, which is used to correct the color deviation caused by different light sources. White balance offset can adjust the color in the image to make it closer to the actual white or neutral tone. The modifiable range of values ​​refers to the adjustable range of each photographic equipment parameter. For example, ISO sensitivity usually has an adjustment range of 100 to 3200, shutter speed from 1 / 4000 second to several seconds, and white balance offset settings are AB and GM axes, with the offset on each axis ranging from -9 to +9, and 0 indicating no offset, such as (A6, M7) and (B9,0).

[0068] It can be understood that LAB values ​​can quantitatively express the three basic properties of color, including brightness, hue, and saturation. After modifying the camera brightness-related parameters (ISO, shutter), the L value can reflect the brightness change, and will not affect the A and B values ​​to a large extent. Similarly, after modifying the camera color parameters (white balance offset), the A and B values ​​can reflect the color change, and have little impact on the L value range. The modification of camera parameters can correspond to the change of LAB values ​​one by one.

[0069] Specifically, the electronic device can adjust several parameters that have the most significant impact on image quality and effect according to the needs of the shooting task or the user's pre-selection. After that, the electronic device sets the adjustment range of each parameter according to the hardware capabilities and shooting requirements. The electronic device can also provide an adjustment range through the software interface, and the user can select a suitable value within this range. Then, the electronic device regards the adjustable range of each parameter as a set and uses a combination algorithm to generate multiple parameter combinations. For example, ISO is 100, 200, 400, the shutter is 1 / 1000 second, 1 / 500 second, 1 / 250 second, and the white balance is 3000K, 5000K, 7000K, and all possible parameter combinations are automatically arranged and combined to form multiple complete setting schemes.

[0070] In this embodiment, first, by determining the key parameters for modification, it is possible to ensure that the settings that have the greatest impact on the image color quality are adjusted, without wasting time on unnecessary parameters. Secondly, by clarifying the modifiable range of the values ​​of each parameter, it is possible to ensure that the device operates within a reasonable range, avoiding image distortion or performance loss caused by excessive adjustment. Finally, by permuting and combining the modifiable range of each parameter, the best shooting settings can be found among multiple possible configurations.

[0071] In one embodiment, before the step of determining the modifiable range of each key imaging device parameter, the method further includes:

[0072] Among various photographic equipment parameters of the photographic equipment, photographic equipment parameters other than the key photographic equipment parameters are used as fixed photographic equipment parameters, and the values ​​of the fixed photographic equipment parameters are kept unchanged.

[0073] Among them, fixed photography equipment parameters refer to parameters that do not need to be adjusted during the shooting process and whose settings have little impact on the current target shooting task. They remain unchanged when other key parameters are adjusted, such as the focus mode is set to automatic and the aperture value is fixed at a certain value.

[0074] Specifically, the electronic device automatically identifies which parameters can be used as fixed photographic device parameters based on predefined rules or shooting scenes. For example, when the user specifies ISO, shutter, and white balance offset as key parameters, the focus mode, aperture value, image resolution, etc. are set as fixed parameters. During the parameter adjustment process, the value of the fixed photographic device parameter is locked and does not change with changes in other parameters. For example, during shooting, the aperture value is locked at f / 5.6 set by the user, while the key parameters are optimized and adjusted. In addition, firmware-level write protection can be used to prevent users from accidentally modifying these fixed parameters.

[0075] In this embodiment, the parameters other than the key photographic device parameters are set to fixed values ​​and remain unchanged in order to ensure that the effects of other parameters on image quality are controllable while optimizing specific parameters. In addition, since there is no need to frequently adjust the fixed photographic device parameters, the electronic device can reduce unnecessary calculations and operations and improve efficiency.

[0076] In one embodiment, the step of calculating the difference between each test LAB value and the reference LAB value includes:

[0077] For each test LAB value, the L difference, A difference and B difference between the test LAB value and the reference LAB value are calculated respectively, and the sum of the absolute values ​​of the L difference, the A difference and the B difference is calculated to obtain the difference between the test LAB value and the reference LAB value.

[0078] Specifically, first, the electronic device obtains the LAB value of the test image and the LAB value of the reference image. Then, the difference is calculated in the three dimensions of L, A, and B respectively, and the absolute values ​​of the L difference, A difference, and B difference are added to obtain the overall color difference between each test image and the reference image. For example, L difference = L reference value - L test value, A difference = A reference value - A test value, B difference = B reference value - B test value, and the total difference is the sum of the LAB differences, that is, the total difference = |L difference| + |A difference| + |B difference|.

[0079] In this embodiment, by calculating the L, A and B differences between each test LAB value and the reference LAB value and summing up the absolute values ​​of these differences, the image color difference can be accurately quantified.

[0080] In one embodiment, when the difference corresponding to the preselected LAB value is within a preset LAB difference range, the step of using the preselected LAB value as the target LAB value includes:

[0081] The L difference, A difference and B difference corresponding to the pre-selected LAB value are compared with the L difference range, A difference range and B difference range in the LAB difference range. If the L difference, A difference and B difference corresponding to the pre-selected LAB value are all within the LAB difference range, the pre-selected LAB value is used as the target LAB value.

[0082] Specifically, the electronic device will compare the L difference, A difference and B difference of the pre-selected LAB value with the L, A and B difference ranges in the LAB difference range one by one, that is, check whether the L difference is within the L difference range, whether the A difference is within the A difference range, and whether the B difference is within the B difference range. If all three differences meet the range conditions, the pre-selected LAB value is determined to meet the requirements. Once the pre-selected LAB value passes the check of all difference ranges, it is marked as the target LAB value.

[0083] In this embodiment, by comparing the L difference, A difference and B difference of the pre-selected LAB value one by one to see if they are within the LAB difference range, the target LAB value that meets the set conditions can be effectively screened out, ensuring the accuracy in selecting the color reference and avoiding color restoration deviations due to excessive differences in individual dimensions, thereby improving the stability of color adjustment of the photographic equipment and the image restoration effect.

[0084] To facilitate understanding of the solution of the present application, specific examples are provided below for illustration.

[0085] The base shooting environment illumination of this example is 563lx. First restore the camera to default settings, and then set the specified parameters according to the following fixed parameter table:

[0086]

[0087] In the benchmark environment, use the given equipment parameters to take photos of the benchmark sample and obtain the benchmark LAB values ​​(88.9, 10.1, -2.4) of the benchmark sample photos.

[0088] Next, place the photographic equipment in a shooting environment with a brightness of 100lx, and conduct a comprehensive traversal within the adjustable range of the photographic equipment parameters to form different combinations of photographic equipment parameters, and perform a shooting operation on the benchmark sample for each combination, that is, perform a shooting operation on all combinations of photographic equipment parameters. Extract the test LAB value of each electronic photo and record the corresponding photographic equipment parameter configuration, as shown in the following table:

[0089]

[0090] Among all the test LAB values, the test LAB value with the smallest difference with the reference LAB value is selected. Through calculation, the test LAB value with the smallest difference with the reference LAB value in the current shooting test environment is (89.4, 9.3, -2.1).

[0091] The preset LAB difference range is (L±3, A±1.5, B±1.5). The difference between the selected test LAB value and the benchmark LAB value is calculated as △LAB(0.5, 0.8, 0.3). It is judged whether △LAB is within the preset range. By comparison, it can be seen that the △LAB difference (0.5, 0.8, 0.3) is within the LAB difference range (L±3, A±1.5, B±1.5), so the current environment meets the shooting requirements.

[0092] Based on this, the photos taken in the current environment of this example can restore the colors of the reference object photos with high precision, that is, the sample photos can be restored with high precision, and the corresponding parameters of the modifiable parameter configuration of the photographic equipment are adjusted as follows:

[0093]

[0094] The following is a description of a photo color restoration device based on photographic device parameters provided in an embodiment of the present application. The photo color restoration device based on photographic device parameters described below and the photo color restoration method based on photographic device parameters described above can be referred to in correspondence with each other. Figure 2 As shown, the present application provides a photo color restoration device based on photographic equipment parameters, the device comprising:

[0095] The reference photo shooting module 201 is used to set the photographic device according to the preset reference photographic device parameters when it is determined that the photographic device has been placed in the reference environment, and trigger the set photographic device to shoot the preset reference photo to obtain an electronic photo corresponding to the reference environment;

[0096] A reference LAB value determination module 202 is used to calculate the average RGB value of the interest area in the electronic photo corresponding to the reference environment, and convert the average RGB value into a reference LAB value;

[0097] The test LAB value determination module 203 is used to determine a plurality of photographic device parameter combinations of the photographic device, and extract the test LAB value of each photographic device parameter combination corresponding to the electronic photo in the actual shooting environment;

[0098] The target LAB value determination module 204 is used to calculate the difference between each test LAB value and the reference LAB value, and use the test LAB value with the smallest difference as the pre-selected LAB value, and when the difference corresponding to the pre-selected LAB value is within a preset LAB difference range, use the pre-selected LAB value as the target LAB value;

[0099] The photographic device setting module 205 is used to set the photographic device according to the photographic device parameter combination corresponding to the target LAB value, so as to restore the color of the photo taken by the photographic device in the actual shooting environment.

[0100] In one embodiment, the test LAB value determination module 203 includes:

[0101] a key photographic device parameter determination unit, configured to determine, among various photographic device parameters of the photographic device, key photographic device parameters for modification, the key photographic device parameters including ISO sensitivity, shutter speed, and white balance offset;

[0102] The photographic equipment parameter combination determination unit is used to determine the modifiable range of the value of each key photographic equipment parameter, and arrange and combine the values ​​of each key photographic equipment parameter according to the modifiable range of the value of each key photographic equipment parameter to obtain multiple photographic equipment parameter combinations.

[0103] In one embodiment, before the photographic device parameter combination determination unit, the method further includes:

[0104] The fixed photographic equipment parameter determination unit is used to use the photographic equipment parameters other than the key photographic equipment parameters as fixed photographic equipment parameters among various photographic equipment parameters of the photographic equipment, and keep the values ​​of the fixed photographic equipment parameters unchanged.

[0105] In one embodiment, the target LAB value determination module 204 includes:

[0106] The LAB difference calculation unit is used to calculate, for each test LAB value, the L difference, the A difference and the B difference between the test LAB value and the reference LAB value, and calculate the sum of the absolute values ​​of the L difference, the A difference and the B difference to obtain the difference between the test LAB value and the reference LAB value.

[0107] In one embodiment, the target LAB value determination module 204 includes:

[0108] The target LAB value determination unit is used to compare the L difference, A difference and B difference corresponding to the pre-selected LAB value with the L difference range, A difference range and B difference range in the LAB difference range. If the L difference, A difference and B difference corresponding to the pre-selected LAB value are all within the LAB difference range, the pre-selected LAB value is used as the target LAB value.

[0109] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the photo color restoration method based on photographic equipment parameters as described in any of the above embodiments.

[0110] In one embodiment, the present application also provides an electronic device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the photo color restoration method based on photographic device parameters as described in any of the above embodiments.

[0111] Indicatively, if Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application. The electronic device 300 can be provided as a server. Figure 3 The electronic device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301, for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the photo color restoration method based on the photographic device parameters of any of the above embodiments.

[0112] The electronic device 300 may further include a power supply component 303 configured to perform power management of the electronic device 300, a wired or wireless network interface 304 configured to connect the electronic device 300 to a network, and an input / output (I / O) interface 305. The electronic device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM or the like.

[0113] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

[0115] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0116] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for restoring photo colors based on photographic equipment parameters, characterized in that: The method comprises: When it is determined that the photographic device has been placed in the reference environment, the photographic device is set according to the preset reference photographic device parameters, and the set photographic device is triggered to shoot a preset reference photo to obtain an electronic photo corresponding to the reference environment; Calculating an average RGB value of an area of ​​interest in the electronic photo corresponding to the reference environment, and converting the average RGB value into a reference LAB value; Determine a plurality of photographic device parameter combinations of the photographic device, and extract a test LAB value of each photographic device parameter combination corresponding to an electronic photo in an actual shooting environment; Calculate the difference between each of the test LAB values ​​and the reference LAB value, and use the test LAB value with the smallest difference as the preselected LAB value, and when the difference corresponding to the preselected LAB value is within a preset LAB difference range, use the preselected LAB value as the target LAB value; The photographic device is set according to the photographic device parameter combination corresponding to the target LAB value to restore the color of the photo taken by the photographic device in the actual shooting environment.

2. The method for photo color restoration based on photographic equipment parameters according to claim 1, characterized in that: The step of determining a plurality of photographic device parameter combinations of photographic devices comprises: Determining key photographic device parameters for modification among various photographic device parameters of the photographic device, wherein the key photographic device parameters include ISO sensitivity, shutter speed, and white balance offset; The modifiable range of the value of each key photographic equipment parameter is determined, and the values ​​of each key photographic equipment parameter are arranged and combined according to the modifiable range of the value of each key photographic equipment parameter to obtain the plurality of photographic equipment parameter combinations.

3. The method for photo color restoration based on photographic equipment parameters according to claim 2, characterized in that: Before the step of determining the modifiable range of each of the key photographic equipment parameters, the method further includes: Among the various photographic device parameters of the photographic device, the photographic device parameters other than the key photographic device parameters are used as fixed photographic device parameters, and the values ​​of the fixed photographic device parameters are kept unchanged.

4. The method for photo color restoration based on photographic equipment parameters according to claim 1, characterized in that: The step of calculating the difference between each of the test LAB values ​​and the reference LAB value comprises: For each of the test LAB values, the L difference, A difference and B difference between the test LAB value and the reference LAB value are calculated respectively, and the sum of the absolute values ​​of the L difference, the A difference and the B difference is calculated to obtain the difference between the test LAB value and the reference LAB value.

5. The method for photo color restoration based on photographic equipment parameters according to claim 4, characterized in that: The step of using the preselected LAB value as the target LAB value when the difference corresponding to the preselected LAB value is within a preset LAB difference range comprises: The L difference, A difference and B difference corresponding to the preselected LAB value are compared with the L difference range, A difference range and B difference range in the LAB difference range. If the L difference, A difference and B difference corresponding to the preselected LAB value are all within the LAB difference range, the preselected LAB value is used as the target LAB value.

6. A photo color restoration device based on photographic equipment parameters, characterized in that: The device comprises: A reference photo shooting module is used to set the photographic device according to preset reference photographic device parameters when it is determined that the photographic device has been placed in the reference environment, and trigger the set photographic device to shoot a preset reference photo to obtain an electronic photo corresponding to the reference environment; A reference LAB value determination module, used to calculate an average RGB value of an area of ​​interest in the electronic photo corresponding to the reference environment, and convert the average RGB value into a reference LAB value; A test LAB value determination module, used to determine a plurality of photographic device parameter combinations of the photographic device, and extract a test LAB value of each photographic device parameter combination for an electronic photograph in an actual shooting environment; a target LAB value determination module, configured to calculate the difference between each of the test LAB values ​​and the reference LAB value, and use the test LAB value with the smallest difference as the preselected LAB value, and when the difference corresponding to the preselected LAB value is within a preset LAB difference range, use the preselected LAB value as the target LAB value; The photographic device setting module is used to set the photographic device according to the photographic device parameter combination corresponding to the target LAB value, so as to restore the color of the photo taken by the photographic device in the actual shooting environment.

7. The device for restoring photo color based on photographic equipment parameters according to claim 6, characterized in that: The test LAB value determination module comprises: a key photographic device parameter determination unit, configured to determine a key photographic device parameter for modification among various photographic device parameters of the photographic device, wherein the key photographic device parameter includes ISO sensitivity, shutter speed, and white balance offset; The photographic equipment parameter combination determination unit is used to determine the modifiable range of the numerical value of each of the key photographic equipment parameters, and to arrange and combine the numerical values ​​of each of the key photographic equipment parameters according to the modifiable range of the numerical value of each of the key photographic equipment parameters to obtain the multiple photographic equipment parameter combinations.

8. The method for photo color restoration based on photographic equipment parameters according to claim 7, characterized in that: Before the photographic equipment parameter combination determination unit, it also includes: The fixed photographic equipment parameter determination unit is used to use the photographic equipment parameters other than the key photographic equipment parameters as fixed photographic equipment parameters among the various photographic equipment parameters of the photographic equipment, and keep the values ​​of the fixed photographic equipment parameters unchanged.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the photo color restoration method based on photographic equipment parameters as described in any one of claims 1 to 5.

10. An electronic device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the photo color restoration method based on photographic device parameters as described in any one of claims 1 to 5 are performed.