Method and apparatus for fast camera image effect adjustment

CN117676299BActive Publication Date: 2026-11-03SHENZHEN FUJIKAM IND DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210979547.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-16
Publication Date
2026-11-03
Estimated Expiration
2042-08-16

AI Technical Summary

Technical Problem

Existing cameras require a high frame rate mode for image effect adjustment upon startup, which places a heavy burden on the image sensor and image effect adjustment module. Furthermore, the adjustment is not fast enough in low frame rate mode, making it impossible to output image information that is consistent with the actual environment in a timely manner.

Method used

By acquiring photosensitivity values, a key is constructed, which is then used to query the cached or default image parameter table. The frame rate of the image sensor is set to the target frame rate, and image information is output. The image parameters are automatically learned and cached using the photosensitivity values ​​to adapt to different environments.

Benefits of technology

It enables rapid adjustment of image effects in low frame rate mode, outputting image information consistent with the actual environment, avoiding the problem of untimely adjustment in high frame rate mode, and has an automatic learning function to adapt to different image scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117676299B_ABST
    Figure CN117676299B_ABST
Patent Text Reader

Abstract

The application provides a method for quickly adjusting image effects of a camera, which comprises the following steps: acquiring a light sensitivity value; acquiring corresponding application image parameters according to the light sensitivity value; setting an image sensor according to the application image parameters; setting a frame rate of the image sensor as a target frame rate; and outputting image information collected by the image sensor. The method for quickly adjusting image effects of the camera according to the embodiment of the application can quickly complete the image effect adjustment process and output image information basically consistent with an actual environment when the image sensor is in a low frame rate mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical fields of video surveillance, image acquisition, and image adjustment, and in particular to a method and apparatus for rapidly adjusting the image effect of a camera. Background Technology

[0002] When a camera starts up, it typically needs to initialize and configure the image sensor, including settings such as frame rate, exposure lines, and exposure gain. The image information output by the image sensor may deviate from the actual environment, such as color cast or underexposure. Therefore, it usually needs to be adjusted by an image effect adjustment module based on the image information. After adjustment, the output image information can be basically consistent with the actual environment.

[0003] Many video surveillance applications, especially battery-powered cameras, require the cameras to remain in sleep mode most of the time. They are only activated when an anomaly is detected, such as when a human infrared sensor detects someone passing by. To capture and store images of the event, the camera must be able to output accurate image data as quickly as possible after startup; that is, color and brightness must match the actual environment. Otherwise, the camera may fail to effectively capture the monitored target.

[0004] Current methods typically involve setting a high frame rate, such as 120 frames per second, during image sensor initialization. Because of the higher frame rate, the time required to adjust image effects is shorter. After adjustment, the image sensor's frame rate is set to the target frame rate, such as 30 frames per second, and then normal image information is output at the target frame rate. However, this method requires the image sensor to support high frame rate mode, and the image effect adjustment module needs to adjust sufficiently quickly in high frame rate mode. Summary of the Invention

[0005] To address the aforementioned issues of initializing the image sensor at a high frame rate, requiring the image sensor to support a high frame rate mode, and necessitating that the image effect adjustment module adjusts sufficiently quickly in high frame rate mode, this invention proposes the following technical solution:

[0006] A method for quickly adjusting image effects in a camera includes the following steps:

[0007] Obtain photosensitivity value;

[0008] The corresponding application image parameters are obtained through the photosensitivity value;

[0009] The image sensor is configured using the applied image parameters;

[0010] Set the frame rate of the image sensor to the target frame rate;

[0011] Output the image information acquired by the image sensor;

[0012] The step of obtaining the corresponding application image parameters through the photosensitivity value includes:

[0013] A key is constructed by generating a photosensitive value from the aforementioned photosensitive value;

[0014] The corresponding cached image parameter table is queried by constructing a key using the photosensitive value, and the corresponding cached image parameters are read. The cached image parameter table is a correspondence table between the updated photosensitive value and the image parameters when the image is stable in actual applications.

[0015] If the read is successful, the cached image parameters are used as the application image parameters;

[0016] If the read fails, the default image parameter table is queried by constructing a key using the photosensitivity value, and the corresponding default image parameter is read as the application image parameter. The default image parameter table is a correspondence table between the photosensitivity value obtained under the experimental environment and the image parameter when the image is stable.

[0017] Furthermore, the step of generating a photosensitive value and constructing a key using the photosensitive value includes:

[0018] Determine the type of the photosensitivity value;

[0019] Generate a key feature character based on the type of the photosensitive value;

[0020] The index value of the key is constructed based on the photosensitive value.

[0021] Generate the photosensitive value construction key, which includes a feature character and an index value.

[0022] Furthermore, the step of constructing a key using the photosensitivity value to query the corresponding cached image parameter table and read the corresponding cached image parameters includes:

[0023] The cached image parameter table to be queried is determined by constructing the key feature through the photosensitive value. The cached image parameter table is a correspondence table between the photosensitive interval of the cache update and the image parameters when the image is stable in actual application. The photosensitive interval is formed by dividing the continuous photosensitive value into several equal parts, and each equal part is a photosensitive interval.

[0024] The index value of the key is constructed using the photosensitive value to query the photosensitive interval corresponding to the photosensitive value;

[0025] Read the cached image parameters corresponding to the photosensitive region of the index value;

[0026] If the read is successful, the cached image parameters will be used as the applied image parameters;

[0027] If the read fails, then read the buffered image parameters of the adjacent photosensitive region:

[0028] If the cached image parameters of the adjacent photosensitive region are successfully read, then the cached image parameters of the adjacent photosensitive region are used as the application image parameters.

[0029] If reading the cached image parameters of an adjacent photosensitive region fails, the default image parameter table is queried using the photosensitive value as a key.

[0030] Furthermore, the acquisition of photosensitivity values ​​includes:

[0031] Obtain soft photosensitivity value;

[0032] The steps for obtaining the soft photosensitivity value are as follows:

[0033] Get the loader;

[0034] Using the loading program, the automatic exposure function of the image effect adjustment module is turned off in sequence, the initial frame rate and initial exposure parameters of the image sensor are set, the ambient brightness value calculated and analyzed by the image effect adjustment module is obtained, and the automatic exposure function of the image effect adjustment module is turned on. The ambient brightness value is used as the soft photosensitivity value, and the soft photosensitivity value is used as the photosensitivity value.

[0035] Furthermore, when a photosensitive element is present, the step of acquiring the photosensitive value further includes:

[0036] Hard photosensitivity values ​​are obtained through photosensitive elements;

[0037] Determining whether the current environment is daytime or nighttime using hard photosensitivity values.

[0038] If it is nighttime, turn on the fill light and use the hard photosensitivity value as the photosensitivity value;

[0039] If it is daytime, the soft photosensitivity value obtained in the step of obtaining the soft photosensitivity value is used as the photosensitivity value.

[0040] Furthermore, the step of determining whether the current environment is daytime or nighttime based on the hard photosensitivity value includes:

[0041] By comparing the hard photosensitivity value with the critical intermediate value, it is preliminarily determined whether the current environment is daytime or nighttime. The critical intermediate value is the midpoint between the critical value for switching from daytime to nighttime and the critical value for switching from nighttime to daytime.

[0042] Determine whether the hard photosensitivity value, after adding or subtracting the maximum error value, is within the transition zone. The maximum error value is a preset fixed value. The transition zone is between the critical value for switching from day to night and the critical value for switching from night to day.

[0043] If so, then the preliminary judgment result remains unchanged;

[0044] If not, then switch to the preliminary judgment result.

[0045] Furthermore, after outputting the image information acquired by the image sensor, the method further includes the following steps:

[0046] Obtain image parameters when the image is stable;

[0047] The cached image parameter table is determined based on the photosensitivity value and the image parameters when the image is stable.

[0048] Furthermore, the step of determining whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable includes:

[0049] The cached image parameter table is queried using the photosensitive value to construct a key, and the cached image parameters when the image is stable are read.

[0050] If the read fails, update the cached image parameter table;

[0051] If the read is successful, determine the multiple by which the image parameters when the image is stable differ from the cached image parameters:

[0052] If the image parameters when the image is stable differ from the cached image parameters by more than N times, then the cached image parameter table is updated, where N is a preset fixed value;

[0053] If the image parameters when the image is stable differ from the cached image parameters by less than N times, then the cached image parameter table will not be updated.

[0054] The present invention also proposes a device for quickly adjusting the image effect of a camera, comprising:

[0055] The first acquisition module is used to acquire the photosensitivity value;

[0056] The second acquisition module is used to acquire the corresponding application image parameters based on the photosensitivity value;

[0057] The first setting module is used to set the image sensor through the application image parameters;

[0058] The second setting module is used to set the frame rate of the image sensor to the target frame rate;

[0059] The output module is used to output image information acquired by the image sensor;

[0060] The second acquisition module includes:

[0061] The first generation submodule is used to generate a photosensitive value and construct a key based on the photosensitive value;

[0062] The first reading submodule is used to construct a key through the photosensitive value to query the corresponding cached image parameter table and read the corresponding cached image parameters. The cached image parameter table is a correspondence table between the cached updated photosensitive value and the image parameters when the image is stable in actual applications.

[0063] The first acquisition submodule is used to use the cached image parameters as the application image parameters when the first reading submodule successfully reads the image.

[0064] The second reading submodule is used to construct a key through the photosensitive value to query the default image parameter table when the first reading submodule fails to read, and read the corresponding default image parameters as the application image parameters. The default image parameter table is a correspondence table between the photosensitive value obtained under the experimental environment and the image parameters when the image is stable.

[0065] Furthermore, the device for rapidly adjusting the image effect of the camera also includes:

[0066] The third acquisition module is used to acquire image parameters when the image is stable.

[0067] The first judgment module is used to determine whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable.

[0068] The beneficial effects of this invention are:

[0069] The camera of this invention does not require the image sensor to support high frame rates. It can quickly complete the image effect adjustment process even when the image sensor is in low frame rate mode, outputting image information that is essentially consistent with the actual environment. Furthermore, it avoids the problem of the image effect adjustment module failing to complete adjustments in time at high frame rates. Moreover, the camera of this invention has an automatic learning function, caching and updating image parameters when the image is stable. Through automatic learning, it can adapt well to different image scenarios. Attached Figure Description

[0070] Figure 1 , Figure 2 A flowchart illustrating the steps involved in quickly adjusting the image effect using a camera, according to Embodiment 1 of the present invention.

[0071] Figure 3 A schematic diagram of the steps for obtaining the loader in this invention;

[0072] Figure 4 A flowchart illustrating the steps involved in rapidly adjusting the image effect using a camera, according to Embodiment 2 of the present invention.

[0073] Figure 5 A schematic diagram of the steps for obtaining application image parameters in this invention;

[0074] Figure 6 A flowchart illustrating the steps of updating the cached image parameter table in this invention.

[0075] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0076] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0077] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0078] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:

[0079] Image sensor: Used to acquire image information;

[0080] Image parameters: Parameter information used to initialize the image sensor, including exposure row number, exposure gain, etc.

[0081] Image Effects Adjustment Module: This module processes the image information output by the image sensor and is generally called the ISP (Image Signal Processing) module.

[0082] Hard photosensitive value: The ambient brightness value obtained through a photosensitive element;

[0083] Soft photosensitivity: The ambient brightness value calculated by the software of the image effect adjustment module through image analysis;

[0084] Photosensitive interval: A continuous photosensitive value is divided into several equal parts, one of which is called the photosensitive interval. The size of each photosensitive interval is the step value.

[0085] Default image parameter table: A table pre-stored in the camera's memory showing the correspondence between photosensitivity values ​​obtained under experimental conditions and image parameters when the image is stable;

[0086] Cached Image Parameter Table: This table caches the correspondence between updated photosensitivity values ​​and image parameters when the image is stable, for practical applications.

[0087] The key for constructing the photosensitivity value is determined by the photosensitivity type, photosensitivity value, and step value of the photosensitivity interval. It is used to query the image parameter table corresponding to the photosensitivity value and the photosensitivity interval corresponding to the photosensitivity value.

[0088] Specifically, the photosensitive value is constructed as key = identifier + photosensitive interval index value idx, where the identifier is determined by the type of the photosensitive value, and the photosensitive interval index value idx is determined by the step size of the photosensitive value and the photosensitive interval.

[0089] Optionally,

[0090] When using soft photosensitivity values, the identifier is "s", and the key is constructed by concatenating the letter "s" and the photosensitivity interval index value "idx" to form a string.

[0091] When using hard photosensitivity values, the identifier is "h", and the key is constructed by concatenating the letter "h" and the photosensitivity interval index value idx.

[0092] Optionally,

[0093] The photosensitive interval index value idx = (photosensitive value + step - 1) / step, where step is the step size, which refers to the size of each photosensitive interval;

[0094] It should be noted that the smaller the step size, the more discrete photosensitive intervals there are, which means more photosensitive intervals can be stored for image parameters. Therefore, the initially set image parameters are closer to the image parameters when the image is stable. When the step size is 1, the photosensitive interval index value idx is the photosensitive value.

[0095] Reference Figure 1 , 2 An embodiment of the method for quickly adjusting the image effect of a camera according to the present invention includes the following specific steps:

[0096] S1. Obtain the photosensitivity value;

[0097] S2. Obtain the corresponding application image parameters through the photosensitivity value;

[0098] S3. Set the image sensor using the application image parameters;

[0099] S4. Set the frame rate of the image sensor to the target frame rate;

[0100] S5. Output the image information acquired by the image sensor;

[0101] In step S2 above, the step of obtaining the corresponding application image parameters through the photosensitivity value includes:

[0102] S21. Generate a key by using the photosensitive value;

[0103] S22. Construct a key using the photosensitivity value to query the corresponding cached image parameter table and read the corresponding cached image parameters. The cached image parameter table is a table showing the correspondence between the updated photosensitivity value and the image parameters when the image is stable in actual applications.

[0104] S23. If the reading is successful, the cached image parameters are used as the application image parameters;

[0105] S24. If the reading fails, the default image parameter table is queried by constructing a key using the photosensitive value, and the corresponding default image parameter is read as the application image parameter. The default image parameter table is a correspondence table between the photosensitive value obtained under the experimental environment and the image parameter when the image is stable.

[0106] In step S1 above, the photosensitivity value is the ambient brightness value obtained during the camera startup process. It can be the ambient brightness value obtained by loading the program, which is the soft photosensitivity value; or it can be the ambient brightness value obtained by the photosensitivity element, which is the hard photosensitivity value.

[0107] In steps S2-S3 above, the application image parameters are used to initialize the image sensor. The acquisition of the application image parameters is related to the photosensitivity value. When the photosensitivity value obtained in step S1 is a hard photosensitivity value, the corresponding application image parameters are obtained through the hard photosensitivity value; when the photosensitivity value obtained in step S1 is a soft photosensitivity value, the corresponding application image parameters are obtained through the soft photosensitivity value.

[0108] In step S4 above, the target frame rate is used to initialize the image sensor. It is the frame rate when the image is stable. The frame rate when the image is stable is a fixed value, preferably 15 frames.

[0109] In step S5 above, the image information acquired by the image sensor is the initial image information. Since the application image parameters used to initialize the image sensor are already very close to the image parameters when the image is stable, the image adjustment module does not need to make too many adjustments to output image information that is basically consistent with the actual environment, thereby completing the image effect adjustment process relatively quickly.

[0110] In step S21, the generation of the photosensitive value construction key is related to the photosensitive value type and the photosensitive value;

[0111] In step S22, when the photosensitive value is a hard photosensitive value, the cached image parameter table corresponding to the hard photosensitive value is queried using the key constructed by the photosensitive value, and the cached image parameter corresponding to the photosensitive value is read; when the photosensitive value is a soft photosensitive value, the cached image parameter table corresponding to the soft photosensitive value is queried using the key constructed by the photosensitive value, and the cached image parameter corresponding to the soft photosensitive value is read.

[0112] In steps S23-S24, the photosensitive value is constructed by first querying the cached image parameter table corresponding to the photosensitive value. If the corresponding cached image parameter is found, it is used as the application image parameter. If the corresponding cached image parameter is not found, the default image parameter table is queried and the corresponding default image parameter is used as the application image parameter.

[0113] Initializing the image sensor using image parameters at image stabilization allows the initial image output by the image sensor in low frame rate mode to closely resemble the image effect at image stabilization. This eliminates the need for extensive adjustments by the image effect adjustment module, enabling the output of an image effect essentially consistent with the actual environment and achieving fast and stable image output. To obtain the image parameters at image stabilization, this application establishes a default image parameter table and a cached image parameter table. The default image parameter table maps photosensitivity values ​​obtained under experimental conditions to the image parameters at image stabilization. The cached image parameter table maps updated photosensitivity values ​​to the image parameters at image stabilization during actual application. When the camera starts, it first generates a key based on the photosensitivity value, then queries the corresponding cached image parameter table using the key to read the cached image parameters corresponding to the photosensitivity value's range. If the read is successful, the image sensor is initialized using the cached image parameters; otherwise, the default image parameter table is queried using the key to read the default image parameters corresponding to the photosensitivity value's range, and the image sensor is initialized using the default image parameters.

[0114] Furthermore, in step S1 above, obtaining the photosensitivity value includes:

[0115] S11. Obtain the soft photosensitivity value;

[0116] S111, Obtain the loader;

[0117] S112. Using the loading program, the automatic exposure function of the image effect adjustment module is turned off in sequence, the initial frame rate and initial exposure parameters of the image sensor are set, the soft photosensitivity value obtained by the image effect adjustment module from the image calculation and analysis is obtained, and the automatic exposure function of the image effect adjustment module is turned on, wherein the soft photosensitivity value is used as the photosensitivity value.

[0118] In steps S11, S111, and S112 above, regardless of whether the camera has a photosensitive element, the loading program will be automatically acquired after the camera is started. (See attached diagram.) Figure 3 The loading program sequentially disables the automatic exposure function of the image effect adjustment module, sets the initial frame rate and initial exposure parameters of the image sensor, obtains the soft photosensitivity value calculated and analyzed by the image effect adjustment module, and then enables the automatic exposure function of the image effect adjustment module. Specifically, disabling the automatic exposure function of the image effect adjustment module is to make the temporary image acquired by the image sensor better reflect the ambient brightness value; setting the initial frame rate and initial exposure parameters of the image sensor is to initialize the image sensor to acquire the temporary image. The initial frame rate is preferably 30 frames, and a higher frame rate than the target frame rate is to make the temporary image imaging speed faster. The initial exposure line count is not limited to 330, and the exposure gain is not limited to 64; the ambient brightness value obtained by the camera's image effect adjustment module from the analysis and calculation of the temporary image is the soft photosensitivity value. Obtaining the ambient brightness value through software analysis and calculation of the image is existing technology in this field and will not be elaborated on here; enabling the automatic exposure function of the image effect adjustment module restores the camera's automatic exposure mode.

[0119] Furthermore, obtaining the photosensitivity value in step S1 above also includes the following steps:

[0120] S12. Obtain hard photosensitivity value through photosensitive element;

[0121] S13. Determine whether the current environment is daytime or nighttime based on the hard photosensitivity value;

[0122] S14. If it is nighttime, turn on the fill light, and use the hard photosensitive value as the photosensitive value;

[0123] S15. If it is daytime, the soft photosensitivity value is obtained by loading the program, and the soft photosensitivity value is used as the photosensitivity value.

[0124] Steps S12-S15 described above are performed under the condition that a photosensitive element exists in the camera, as shown in the appendix. Figure 4After the camera is started, the photosensitive element is powered on, and the ambient brightness value can be quickly obtained through the photosensitive element. However, due to the inherent accuracy limitations of the photosensitive element, it cannot distinguish between scenes with relatively bright ambient light and scenes with very bright ambient light. Therefore, this application proposes to use the ambient brightness value obtained by the photosensitive element as the photosensitive value for obtaining application image parameters when the light is dim at night; and to use the ambient brightness value obtained by the loading program as the photosensitive value for obtaining application image parameters when the light is bright during the day. Furthermore, this application proposes to determine whether the current environment is day or night by using the ambient brightness value obtained when the photosensitive element is first powered on, i.e., the hard photosensitive value. If it is night, a supplementary light is turned on for supplementary lighting, and the hard photosensitive value is used as the photosensitive value for obtaining application image parameters; if it is day, the soft photosensitive value obtained by the loading program is used as the photosensitive value for obtaining application image parameters.

[0125] In step S12, the hard photosensitivity value is the ambient brightness value read when the photosensitivity element is first powered on;

[0126] In step S13, the specific steps for determining whether the current environment is daytime or nighttime based on the hard photosensitivity value are as follows (refer to...). Figure 4 The following is the procedure: When the hard photosensitivity value is greater than the threshold value d2n for switching from day to night, the system switches to daytime; when the hard photosensitivity value is less than the threshold value n2d for switching from night to day, the system switches to nighttime. Since the application periodically reads the photosensitivity value and checks whether a switch to day or night is necessary, a transition zone is set to prevent frequent day / night switching due to photosensitivity value fluctuations. When the photosensitivity value is within this zone, the previous day / night determination is maintained, and no switch is performed.

[0127] In step S14, when the current environment is determined to be nighttime based on the hard photosensitivity value, it is necessary to turn on the fill light to provide fill light in order to obtain better image effects. The hard photosensitivity value is used as the photosensitivity value to obtain the corresponding application image parameters.

[0128] In step S15, when the current environment is determined to be daytime by the hard photosensitivity value, the photosensitivity element itself has a precision limitation and cannot distinguish between scenes with bright ambient light and scenes with very bright ambient light. Therefore, the soft photosensitivity value obtained by the loading program is used as the photosensitivity value to obtain the application image parameters.

[0129] Furthermore, the step of determining whether the current environment is daytime or nighttime using the hard photosensitivity value in step S12 above includes:

[0130] S121. Compare the hard photosensitivity value with the critical intermediate value to preliminarily determine whether the current environment is daytime or nighttime. The critical intermediate value is the midpoint between the critical value for switching from daytime to nighttime and the critical value for switching from nighttime to daytime.

[0131] S122. Determine whether the hard photosensitivity value, after adding or subtracting the maximum error value, is within the transition region:

[0132] S1221. If so, then maintain the preliminary judgment result;

[0133] S1222. If not, switch the preliminary judgment result. The maximum error value is a preset fixed value. The transition zone is between the critical value for switching from daytime to nighttime and the critical value for switching from nighttime to daytime.

[0134] In step S121, since the hard photosensitivity value read when the photosensitive element is first powered on is smaller than the hard photosensitivity value when it is stable, when using the hard photosensitivity value to determine whether it is day or night, whether the threshold value n2d for switching from night to day or the threshold value d2n for switching from day to night is selected as the threshold value, it may result in the initial determination of night upon startup, but switching back to daytime after the photosensitive element stabilizes. Therefore, see [link to relevant documentation]. Figure 5 This application proposes to compare the hard photosensitivity value with a critical intermediate value. When the hard photosensitivity value is greater than the critical intermediate value, it is preliminarily determined that the current environment is daytime; when the hard photosensitivity value is less than the critical intermediate value, it is preliminarily determined that the current environment is nighttime.

[0135] In step S122, the maximum error value refers to the difference between the ambient brightness value when the photosensitive element is first powered on and the ambient brightness value after the photosensitive element has stabilized; it is a fixed value. The transition zone is between the critical value d2n for switching from day to night and the critical value n2d for switching from night to day. If the hard photosensitive value plus or minus the maximum error value is still within the transition zone, the preliminary judgment result is maintained; if the hard photosensitive value plus or minus the maximum error value is not within the transition zone, the preliminary judgment result is switched.

[0136] Specifically, when the hard photosensitivity value is greater than the critical intermediate value, it is initially determined that the current environment is daytime; if the maximum error value of the hard photosensitivity value plus or minus is within the transition zone, the initial determination result is maintained and the current environment is determined to be daytime; if the maximum error value of the hard photosensitivity value plus or minus is not within the transition zone, the initial determination result is switched and the current environment is determined to be nighttime.

[0137] If the hard photosensitivity value is less than the critical intermediate value, it is initially determined that the current environment is nighttime; if the hard photosensitivity value plus or minus the maximum error value is within the transition zone, the initial judgment result is maintained and the current environment is determined to be nighttime; if the hard photosensitivity value plus or minus the maximum error value is not within the transition zone, the initial judgment result is switched and the current environment is determined to be daytime.

[0138] Optionally,

[0139] Take the critical intermediate value threshold = (((d2n+n2d) / 2) / step)*step (step is the step size of the photosensitive interval);

[0140] Take the maximum error value adc_diff = adc - sdac, where adc_diff is a fixed value, (n²d - d²n) > 2 * adc_diff, and:

[0141] sadc: The photosensitive value read when power is first applied;

[0142] adc: The photosensitive value read after the photosensitive element has stabilized after being powered on for a period of time;

[0143] d2n: The threshold for switching from daytime to nighttime;

[0144] n2d: The threshold value for switching from nighttime to daytime;

[0145] If the hard photosensitivity value is greater than the threshold, it is initially determined that the current environment is daytime. If the hard photosensitivity value plus or minus the maximum error value adc_diff is still within the transition zone trans_zone, the determination that the current environment is daytime is maintained. If the hard photosensitivity value plus or minus the maximum error value adc_diff is not within the transition zone trans_zone, the determination that the current environment is daytime is changed, that is, the current environment is nighttime.

[0146] If the hard photosensitivity value is less than the threshold, it is initially determined that the current environment is nighttime. If the hard photosensitivity value plus or minus the maximum error value adc_diff is still within the transition zone, the determination that the current environment is nighttime is maintained. If the hard photosensitivity value plus or minus the maximum error value adc_diff is not within the transition zone, the determination that the current environment is nighttime is changed, i.e., the current environment is daytime.

[0147] For ease of understanding, the following are optional examples:

[0148] Let the step size be step = 100;

[0149] The critical intermediate value threshold = (((d2n+n2d) / 2) / step)*step, that is, take the intermediate value, discard the decimal in the division calculation result, and align the final result to the step size;

[0150] Let d2n = 1000, n2d = 2200, and adc_diff = 500;

[0151] Then the transition zone trans_zone = [1000, 2200];

[0152] The critical intermediate value threshold is calculated as (((2200+1000) / 2) / 100)*100, which gives threshold = 1600.

[0153] Assuming sadc = 1599, it is determined to be nighttime. When the maximum deviation is reached, i.e. the final adc is 1599-500 = 1099 or 1599+500 = 2099, it is still in the transition zone, so the business will remain unchanged between day and night.

[0154] Assuming sadc = 1601, it is determined to be daytime. When the maximum deviation is reached, i.e. the final adc is 1601-500=1101 or 1601+500=2101, it is still in the transition zone, so the business will remain unchanged during the day and night.

[0155] Furthermore, in step S21 above, the step of generating a photosensitive value and constructing a key using the photosensitive value includes:

[0156] S211. Determine the type of the photosensitivity value;

[0157] S212. Generate a key feature character based on the type of the photosensitive value;

[0158] S213. Generate an index value for the key based on the photosensitive value;

[0159] S214. Generate the photosensitive value construction key, which consists of a feature character and an index value.

[0160] In step S211, the photosensitive value type includes hard photosensitive values ​​obtained through a photosensitive element and soft photosensitive values ​​obtained through a loading program;

[0161] In step S212, when the photosensitivity value is a soft photosensitivity value, the photosensitivity value constructs the key's identifier = 's'; when the photosensitivity value is a hard photosensitivity value, the photosensitivity value constructs the key's identifier = 'h'.

[0162] In step S213, the index value of the key constructed by the photosensitive value corresponds to the photosensitive value and is used to query the photosensitive interval corresponding to the photosensitive value. There is a one-to-one correspondence between the photosensitive value and the image parameters. Cache the photosensitive value and the corresponding image parameters to obtain the cached image parameter table corresponding to the photosensitive value. However, this results in a large number of cached entries, equivalent to each photosensitive value corresponding to an image parameter cache, which puts a lot of pressure on the camera's memory. Therefore, this application proposes to reduce the pressure of caching image parameters by dividing continuous photosensitive values ​​into discrete photosensitive intervals and storing a set of image parameters for each discrete photosensitive interval when the image is stable. The size of the discrete photosensitive interval is a step value (step). The smaller the step value (step), the more discrete photosensitive intervals there are, allowing more photosensitive intervals to store image parameters. Therefore, the initially set image parameters are closer to the image parameters when the image is stable. When the step value is 1, the index value is the photosensitive value.

[0163] In step S214, the photosensitive value construction key consists of the feature identifier and the index value idx.

[0164] Optionally,

[0165] Step 1: Set the step size to include, but is not limited to, step = 100;

[0166] Step 2: Set the index value to include, but is not limited to, idx = (photosensitive value + step - 1) / step;

[0167] Optionally, when using a soft photosensitive sensor, the identifier = s, and the key is constructed by concatenating the letter s and the photosensitive interval index value idx.

[0168] Optionally, when using a hard photosensitive sensor, the identifier = h, and the key is constructed by concatenating the letter h and the photosensitive interval index value idx.

[0169] Furthermore, in step S22 above, the step of constructing a key using the photosensitivity value to query the corresponding cached image parameter table and read the corresponding cached image parameters includes:

[0170] S221. The cached image parameter table to be queried is determined by constructing the key feature through the photosensitive value. The cached image parameter table is a correspondence table between the photosensitive interval of the cache update and the image parameters when the image is stable in actual application. The photosensitive interval is formed by dividing the continuous photosensitive value into several equal parts, and the length of each part is the photosensitive interval.

[0171] S222. Construct an index value for the key using the photosensitive value to query the photosensitive interval corresponding to the photosensitive value;

[0172] S223. Read the cached image parameters corresponding to the photosensitive region of the index value:

[0173] S224. If the reading is successful, the cached image parameters are used as the application image parameters.

[0174] S225. If the read fails, read the buffered image parameters of the adjacent photosensitive area:

[0175] S226. If the reading is successful, the cached image parameters are used as the application image parameters.

[0176] S227. If the reading fails, the default image parameter table is queried by constructing a key using the photosensitive value.

[0177] In steps S221-S222, the photosensitive interval corresponding to the photosensitive value is queried by constructing a key through the photosensitive value. First, the feature of the key constructed by the photosensitive value is used to determine whether to query the cached image parameter table corresponding to the soft photosensitive value or the cached image parameter table corresponding to the hard photosensitive value. Then, the photosensitive interval corresponding to the photosensitive value is queried by the index value.

[0178] In step S223, the cached image parameters corresponding to the photosensitive region of the index value are first read;

[0179] In step S224, if a cache exists in the photosensitive region corresponding to the index value, the cached image parameters are read as the application image parameters.

[0180] In step S225, if there is no cache for the photosensitive interval corresponding to the index value, then the cache of the adjacent photosensitive interval is read. The adjacent photosensitive interval refers to the photosensitive interval above and below the photosensitive interval corresponding to the index value.

[0181] In step S226, if the index value corresponds to the upper and lower photosensitive intervals, and either photosensitive interval has a cache, then the reading is successful, and the cached image parameters are used as the application image parameters.

[0182] In step S227, if neither the upper nor lower photosensitive interval corresponding to the index value has a cache, the read fails. The default image parameter table is queried by constructing a key using the photosensitive value, and the default image parameters are read.

[0183] Furthermore, the method for quickly adjusting the image effect of the camera also includes the following steps.

[0184] S6. Obtain the image parameters when the image is stable;

[0185] S7. Determine whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable.

[0186] In step S6 above, the image parameters when the image is stable are cached into the photosensitive intervals corresponding to the photosensitive values, thereby generating a corresponding cached image parameter table;

[0187] In step S7, the image parameters when the image is stable are compared with the cached image parameters of the photosensitive interval corresponding to the photosensitive value to determine whether to update the cached image parameter table.

[0188] Furthermore, in step S7 above, the step of determining whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable includes:

[0189] S71. Construct a key using the photosensitivity value to query the cached image parameter table and read the cached image parameters corresponding to the photosensitivity value when the image is stable.

[0190] S72. If the read fails, update the cached image parameter table;

[0191] S73. If the read is successful, determine the multiple by which the image parameters when the image is stable differ from the cached image parameters:

[0192] S74. If the image parameters when the image is stable differ from the cached image parameters by more than N times, then update the cached image parameter table, where N is a preset fixed value.

[0193] S76. If the difference between the image parameters when the image is stable and the cached image parameters is less than N times, then the cached image parameter table is not updated.

[0194] In step S71, the photosensitivity value includes hard photosensitivity value and soft photosensitivity value. The photosensitivity value generated by the hard photosensitivity value is used to construct a key for querying the cached image parameter table corresponding to the hard photosensitivity value. The photosensitivity value generated by the soft photosensitivity value is used to construct a key for querying the cached image parameter table corresponding to the soft photosensitivity value.

[0195] In step S72, if the photosensitive range corresponding to the photosensitive value is not cached, the read fails. The image parameters when the image is stable are cached in the corresponding photosensitive range, and the cached image parameter table is updated. Figure 6 ;

[0196] In step S73, if a buffer exists in the photosensitive range corresponding to the photosensitive value, the buffered image parameters are read, and the difference between the image parameters when the image is stable and the buffered image parameters is determined. This difference is the ratio of the product of the exposure value and exposure gain value of the image parameters when the image is stable to the product of the exposure value and exposure gain value of the buffered image parameters. If the ratio is greater than N or less than 1 / N, the buffered image parameters are updated to the image parameters when the image is stable. N is a fixed value, preferably 3. The determination logic is as follows:

[0197] (cur_intt*cur_gain / cache_init*cache_gain)>n or (cur_intt*cur_gain) / (cache_init*cache_gain)<(1 / n);

[0198] in:

[0199] cur_intt: Current exposure value;

[0200] cur_gain: Current exposure gain value;

[0201] cache_intt: Caches exposure values;

[0202] cache_gain: Cache exposure gain value;

[0203] During actual use, the camera continuously caches and updates image parameters when the image is stable, thus forming a cached image parameter table that better reflects the actual environment. During camera startup, the photosensitivity value is first acquired, and a key is constructed using this value. Then, the cached image parameters are read using this key to initialize the image sensor. If the corresponding cached image parameters are not found, the default image parameters are read to initialize the image sensor, resulting in faster and more stable imaging. Through automatic learning, it can adapt well to different image scenarios.

[0204] Furthermore, the present invention also proposes a device for quickly adjusting the image effect of a camera, comprising:

[0205] The first acquisition module is used to acquire the photosensitivity value;

[0206] The second acquisition module is used to acquire the corresponding application image parameters based on the photosensitivity value;

[0207] The first setting module is used to set the image sensor through the application image parameters;

[0208] The second setting module is used to set the frame rate of the image sensor to the target frame rate;

[0209] The output module is used to output image information acquired by the image sensor;

[0210] The second acquisition module includes:

[0211] The first generation submodule is used to generate a photosensitive value and construct a key based on the photosensitive value;

[0212] The first reading submodule is used to construct a key through the photosensitive value to query the corresponding cached image parameter table and read the corresponding cached image parameters. The cached image parameter table is a correspondence table between the cached updated photosensitive value and the image parameters when the image is stable in actual applications.

[0213] The first acquisition submodule is used to use the cached image parameters as the application image parameters when the first reading submodule successfully reads the image.

[0214] The second reading submodule is used to construct a key through the photosensitive value to query the default image parameter table when the first reading submodule fails to read, and read the corresponding default image parameters as the application image parameters. The default image parameter table is a correspondence table between the photosensitive value obtained under the experimental environment and the image parameters when the image is stable.

[0215] Furthermore, the device for quickly adjusting the image effect of the camera also includes:

[0216] The third acquisition module is used to acquire image parameters when the image is stable.

[0217] The second judgment module is used to determine whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable.

[0218] This invention proposes dividing continuous photosensitivity values ​​into discrete photosensitivity intervals. For each discrete interval, a set of image parameters is stored for when the image is stable within that interval. When the camera starts, the photosensitivity value is obtained through image analysis and calculation using the photosensitivity element or software. Then, the corresponding image parameters are retrieved using the photosensitivity value, and the image sensor is initialized with these image parameters. Because these image parameters are very close to the image parameter values ​​when the image is stable, the image adjustment module does not need to make many adjustments to output an image effect that is basically consistent with the actual environment. This allows for faster image effect adjustment and output of image information that is basically consistent with the actual environment, even when the image sensor is in low frame rate mode. In addition, the camera of this application has an automatic learning function, which caches and updates the image parameters when the image is stable. Through automatic learning, it can adapt well to different image scenes.

[0219] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for quickly adjusting image effects in a camera, characterized in that, Includes the following steps: Obtain photosensitivity value; The corresponding application image parameters are obtained through the photosensitivity value; The image sensor is configured using the applied image parameters; The frame rate of the image sensor is set to a target frame rate, which is used to initialize the image sensor and is the frame rate when the image is stable. The frame rate when the image is stable is a fixed value, and the target frame rate is a low frame rate. Output the image information acquired by the image sensor; The step of obtaining the corresponding application image parameters through the photosensitivity value includes: A key is constructed by generating a photosensitive value from the aforementioned photosensitive value; The corresponding cached image parameter table is queried by constructing a key using the photosensitive value, and the corresponding cached image parameters are read. The cached image parameter table is a correspondence table between the updated photosensitive value and the image parameters when the image is stable in actual application. The image stability refers to the steady state where the brightness and color parameters of the camera image no longer fluctuate significantly. If the read is successful, the cached image parameters are used as the application image parameters; If the read fails, the default image parameter table is queried by constructing a key using the photosensitive value, and the corresponding default image parameter is read as the application image parameter. The default image parameter table is a correspondence table between the photosensitive value obtained under the experimental environment and the image parameter when the image is stable. The step of constructing a key using the photosensitivity value to query the corresponding cached image parameter table and read the corresponding cached image parameters includes: The cached image parameter table to be queried is determined by constructing the key feature through the photosensitive value. The cached image parameter table is a correspondence table between the photosensitive interval of the cache update and the image parameters when the image is stable in actual application. The photosensitive interval is formed by dividing the continuous photosensitive value into several equal parts, and each equal part is a photosensitive interval. The index value of the key is constructed using the photosensitive value to query the photosensitive interval corresponding to the photosensitive value; Read the cached image parameters corresponding to the photosensitive region of the index value; If the read is successful, the cached image parameters will be used as the applied image parameters; If the read fails, then read the buffered image parameters of the adjacent photosensitive region: If the cached image parameters of the adjacent photosensitive region are successfully read, then the cached image parameters of the adjacent photosensitive region are used as the application image parameters. If reading the cached image parameters of an adjacent photosensitive region fails, the default image parameter table is queried using the photosensitive value as a key.

2. The method for quickly adjusting the image effect of a camera according to claim 1, characterized in that, The step of generating a photosensitive value and constructing a key using the photosensitive value includes: Determine the type of the photosensitivity value; Generate a key feature character based on the type of the photosensitive value; The index value of the key is constructed by generating the photosensitive value based on the photosensitive value; Generate the photosensitive value construction key, which includes a feature character and an index value.

3. The method for quickly adjusting the image effect of a camera according to claim 1, characterized in that, The step of obtaining the photosensitivity value includes: Obtain soft photosensitivity value; The steps for obtaining the soft photosensitivity value are as follows: Obtain the loader; Using the loading program, the automatic exposure function of the image effect adjustment module is turned off in sequence, the initial frame rate and initial exposure parameters of the image sensor are set, the ambient brightness value calculated and analyzed by the image effect adjustment module is obtained, and the automatic exposure function of the image effect adjustment module is turned on. The ambient brightness value is used as the soft photosensitivity value, and the soft photosensitivity value is used as the photosensitivity value.

4. The method for quickly adjusting the image effect of a camera according to claim 3, characterized in that, When a photosensitive element is present, the step of obtaining the photosensitive value further includes: Hard photosensitivity values ​​are obtained through photosensitive elements; Determining whether the current environment is daytime or nighttime using hard photosensitivity values. If it is nighttime, turn on the fill light and use the hard photosensitivity value as the photosensitivity value; If it is daytime, the soft photosensitivity value obtained in the step of obtaining the soft photosensitivity value is used as the photosensitivity value.

5. The method for quickly adjusting the image effect of a camera according to claim 4, characterized in that, The step of determining whether the current environment is daytime or nighttime based on hard photosensitivity includes: The hard photosensitivity value is compared with the critical intermediate value to preliminarily determine whether the current environment is daytime or nighttime. The critical intermediate value is the midpoint between the critical value for switching from daytime to nighttime and the critical value for switching from nighttime to daytime. The critical value is the mode switching threshold. Determine whether the hard photosensitivity value, after adding or subtracting the maximum error value, falls within the transition zone. The maximum error value is a preset fixed value. The transition zone is between the critical value for switching from daytime to nighttime and the critical value for switching from nighttime to daytime. If so, then the preliminary judgment result remains unchanged; If not, then switch to the preliminary judgment result.

6. The method for quickly adjusting the image effect of a camera according to claim 1, characterized in that, After outputting the image information acquired by the image sensor, the method further includes the following steps: Obtain image parameters when the image is stable; The cached image parameter table is determined based on the photosensitivity value and the image parameters when the image is stable.

7. The method for quickly adjusting image effects of a camera according to claim 6, characterized in that, The step of determining whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable includes: The cached image parameter table is queried using the photosensitive value to construct a key, and the cached image parameters when the image is stable are read. If the read fails, update the cached image parameter table; If the read is successful, determine the multiple by which the image parameters when the image is stable differ from the cached image parameters: If the image parameters when the image is stable differ from the cached image parameters by more than N times, then the cached image parameter table is updated, where N is a preset fixed value; If the image parameters when the image is stable differ from the cached image parameters by less than N times, then the cached image parameter table will not be updated.

8. A device for quickly adjusting image effects in a camera, characterized in that, include: The first acquisition module is used to acquire the photosensitivity value; The second acquisition module is used to acquire the corresponding application image parameters based on the photosensitivity value; The first setting module is used to set the image sensor through the application image parameters; The second setting module is used to set the frame rate of the image sensor to a target frame rate. The target frame rate is used to initialize the image sensor and is the frame rate when the image is stable. The frame rate when the image is stable is a fixed value, and the target frame rate is a low frame rate. The output module is used to output image information acquired by the image sensor; The second acquisition module includes: The first generation submodule is used to generate a photosensitive value and construct a key based on the photosensitive value; The first reading submodule is used to construct a key through the photosensitive value to query the corresponding cached image parameter table and read the corresponding cached image parameters. The cached image parameter table is a correspondence table between the updated photosensitive value and the image parameters when the image is stable in actual application. The image stability refers to the steady state in which the brightness and color parameters of the camera image no longer fluctuate significantly. The first acquisition submodule is used to use the cached image parameters as the application image parameters when the first reading submodule successfully reads the image. The second reading submodule is used to construct a key through the photosensitive value to query the default image parameter table when the first reading submodule fails to read, and read the corresponding default image parameters as the application image parameters. The default image parameter table is a correspondence table between the photosensitive value obtained under the experimental environment and the image parameters when the image is stable. The step of constructing a key using the photosensitivity value to query the corresponding cached image parameter table and read the corresponding cached image parameters includes: The cached image parameter table to be queried is determined by constructing the key feature through the photosensitive value. The cached image parameter table is a correspondence table between the photosensitive interval of the cache update and the image parameters when the image is stable in actual application. The photosensitive interval is formed by dividing the continuous photosensitive value into several equal parts, and each equal part is a photosensitive interval. The index value of the key is constructed using the photosensitive value to query the photosensitive interval corresponding to the photosensitive value; Read the cached image parameters corresponding to the photosensitive region of the index value; If the read is successful, the cached image parameters will be used as the applied image parameters; If the read fails, then read the buffered image parameters of the adjacent photosensitive region: If the cached image parameters of the adjacent photosensitive region are successfully read, then the cached image parameters of the adjacent photosensitive region are used as the application image parameters. If reading the cached image parameters of an adjacent photosensitive region fails, the default image parameter table is queried using the photosensitive value as a key.

9. The apparatus for rapidly adjusting the image effect of a camera according to claim 8, characterized in that, Also includes: The third acquisition module is used to acquire image parameters when the image is stable. The first judgment module is used to determine whether to update the cached image parameter table based on the photosensitivity value and the image parameters when the image is stable.

Citation Information

Patent Citations

  • Image initialization method based on user scene and camera

    CN111327825A