Anti-stroboscopic method, device, computer equipment and storage medium
Through the automatic strobe detection module, the method of detecting the target strobe frequency, exposure smooth calculation and maximum exposure time adjustment, the problem of video flickering and exposure instability caused by strobe of external light sources is solved, and the stability and exposure consistency of video shooting are achieved.
Patent Information
- Application Number
- CN202411874506.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-12-19
AI Technical Summary
When there is strobe in external light sources, the video captured by the camera may flash, corrugated stripes or unstable exposure.
By obtaining the target strobe frequency detected by the automatic strobe detection module, the preliminary exposure time is calculated, and the exposure smoothing calculation is performed in combination with the cached exposure time to obtain the smooth exposure time. The maximum exposure time is determined based on the current motion state and environment type of the camera, and the smooth exposure time is adjusted on this basis to obtain the final exposure time, and the camera is controlled to expose according to the final exposure time during the shooting process.
It effectively eliminates the problem of picture flickering and exposure instability caused by inconsistent sampling frequency and strobe frequency of CMOS photosensitive elements, and improves the stability of video shooting.
Smart Images

Figure CN119325031B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an anti-stroboscopic method, device, computer equipment and storage medium. Background Art
[0002] When the camera is shooting a video, if the external light source is flickering, the video may flicker, have wavy stripes, or unstable exposure.
[0003] Most cameras on the market are usually equipped with complementary metal oxide semiconductor (CMOS) photosensitive elements. Since CMOS scans line by line, if the sampling frequency of CMOS (corresponding to the exposure frequency) is not a multiple of the stroboscopic frequency, the number of lines being scanned by CMOS will not be consistent each time stroboscopic occurs, resulting in the screen showing alternating light and dark flickering or wavy stripes. The automatic exposure system of the camera is generally based on the principle of photometry. However, the brightness change of the stroboscopic light source causes the photometry principle to be inaccurate, resulting in unstable calculated exposure time, which in turn causes the screen to flicker. Therefore, how to effectively solve the problem of flickering, wavy stripes, or unstable exposure in the video shot due to the stroboscopic light source is an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide an anti-stroboscopic method, apparatus, computer device and storage medium. The technical problem to be solved is that, in view of the defects of the prior art, when the external light source is stroboscopic during the process of shooting video with a camera, the shot video may show flickering screen, wavy stripes or unstable exposure.
[0005] In order to solve the above technical problems, a technical solution adopted by the present application is: to provide an anti-stroboscopic method, device, computer equipment and storage medium, wherein the anti-stroboscopic method includes: obtaining a target stroboscopic frequency detected by an automatic stroboscopic detection module, and calculating a preliminary exposure time according to the target stroboscopic frequency; obtaining a cached exposure time, and performing an exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; determining the current motion state of the camera, and determining the type of environment in which the camera is currently located, and determining the maximum exposure time according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, adjusting the smoothed exposure time according to the target stroboscopic frequency to obtain a final exposure time, and controlling the camera to expose according to the final exposure time during shooting.
[0006] In a specific embodiment, to obtain the exposure time of the cache, perform exposure smoothing calculation based on the exposure time of the cache and the preliminary exposure time to obtain the smoothed exposure time, including: setting the current smoothed exposure time as EPsm(k), the exposure time of the cache as EPsm(k - 1), and the current preliminary exposure time as EPs(k), then it satisfies: EPsm(k)=k(ω)EPs(k)+(1 - k(ω))EPsm(k - 1), where k(ω) is a weighting parameter.
[0007] In a specific embodiment, k(ω) is a function related to the angular velocity ω of the camera, and k(ω) satisfies: k(ω)=1 - exp(-λ|ω|), where λ is the sensitivity coefficient of the camera.
[0008] In a specific embodiment, within the maximum exposure time, adjust the smoothed exposure time according to the target stroboscopic frequency to obtain the final exposure time, including: when the target stroboscopic frequency is 60 Hz, adjust the smoothed exposure time to the largest integer multiple of 8.33 ms within the maximum exposure time to obtain the final exposure time; when the target stroboscopic frequency is 50 Hz, adjust the smoothed exposure time to the largest integer multiple of 10 ms within the maximum exposure time to obtain the final exposure time.
[0009] In a specific embodiment, to determine the current motion state of the camera, including: obtaining the current attitude data of the camera, the attitude data including gyroscope data, and the current motion state including a stationary state, a low-speed motion state, a fast motion state, and a high-speed motion state; performing fusion calculation on the gyroscope data to obtain a rotation vector, and quantifying the rotation vector through calculation to a determined value a within the 0 - 1 numerical interval; when the determined value a after quantization of the rotation vector is 0, determining the current motion state as the stationary state; when the determined value a after quantization of the rotation vector is 0 < a ≤ 0.2, determining the current motion state as the low-speed motion state; when the determined value a after quantization of the rotation vector is 0.2 < a ≤ 0.5, determining the current motion state as the fast motion state; when the determined value a after quantization of the rotation vector is 0.5 < a ≤ 1, determining the current motion state as the high-speed motion state.
[0010] In a specific embodiment, determining the type of environment in which the camera is currently located includes: obtaining a current sensitivity of the camera, and determining the type of environment in which the camera is currently located according to the current sensitivity and the cached exposure time, wherein the type of environment in which the camera is currently located includes a bright environment, a dim environment, and a dark environment; when the current sensitivity is less than or equal to 100 and the cached exposure time is less than or equal to 8 ms, determining that the type of environment in which the camera is currently located is a bright environment; when the current sensitivity is greater than 100 and less than or equal to 220 and the cached exposure time is greater than or equal to 10 ms and less than or equal to 30 ms, determining that the type of environment in which the camera is currently located is a dim environment; and when the current sensitivity is greater than 220 and the cached exposure time is greater than 30 ms, determining that the type of environment in which the camera is currently located is a dark environment.
[0011] In a specific embodiment, the maximum exposure time is determined according to the current motion state and the current environment type, including: when the current motion state is a low-speed motion state, the maximum exposure time is determined to be 10ms when the current environment type is a bright environment, and when the current environment type is a dim environment, the maximum exposure time is determined to be 15ms, and when the current environment type is a dark environment, the maximum exposure time is determined to be 30ms; when the current motion state is a fast motion state, the maximum exposure time is determined to be 6ms when the current environment type is a bright environment, and when the current environment type is a dim environment, the maximum exposure time is determined to be 10ms, and when the current environment type is a dark environment, the maximum exposure time is determined to be 30ms; when the current motion state is a high-speed motion state, the maximum exposure time is determined to be 4ms when the current environment type is a bright environment, and when the current environment type is a dim environment, the maximum exposure time is determined to be 6ms, and when the current environment type is a dark environment, the maximum exposure time is determined to be 30ms.
[0012] In a specific embodiment, an anti-stroboscopic device is also provided, and the anti-stroboscopic device includes: a preliminary exposure time calculation module, the preliminary exposure time calculation module is used to obtain the target stroboscopic frequency detected by the automatic stroboscopic detection module, and calculate the preliminary exposure time according to the target stroboscopic frequency; a smoothing exposure time calculation module, the smoothing exposure time calculation module is used to obtain the cached exposure time, and perform exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain the smoothing exposure time; a maximum exposure time calculation module, the maximum exposure time calculation module is used to determine the current motion state of the camera, and determine the type of environment in which the camera is currently located, and determine the maximum exposure time according to the current motion state and the type of environment in which the camera is currently located; a final exposure time determination module, the final exposure time determination module is used to adjust the smoothing exposure time according to the target stroboscopic frequency within the maximum exposure time to obtain the final exposure time, and control the camera to expose according to the final exposure time during shooting.
[0013] In a specific embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the anti-stroboscopic method described in any of the above specific embodiments are implemented.
[0014] In a specific embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the anti-stroboscopic method described in any of the above specific embodiments are implemented.
[0015] The beneficial effects of the present application are as follows: different from the prior art, the embodiments of the present application provide an anti-stroboscopic method, device, computer equipment and storage medium, the anti-stroboscopic method comprising: obtaining a target stroboscopic frequency detected by an automatic stroboscopic detection module, and calculating a preliminary exposure time according to the target stroboscopic frequency; obtaining a cached exposure time, and performing an exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; determining the current motion state of the camera, and determining the type of environment in which the camera is currently located, and determining a maximum exposure time according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, adjusting the smoothed exposure time according to the target stroboscopic frequency to obtain a final exposure time, and controlling the camera to expose according to the final exposure time during shooting.
[0016] It can be seen from the above technical scheme that the embodiments of the present application have the following advantages: a preliminary exposure time is calculated according to the target stroboscopic frequency detected by the automatic stroboscopic detection module, and then the exposure smoothing calculation is performed in combination with the cached exposure time to obtain a smoothed exposure time. Finally, the maximum exposure time is determined according to the current motion state of the camera and the type of environment in which the camera is currently located. The smoothed exposure time is further adjusted within this maximum exposure time to obtain the final exposure time. Exposure is performed according to the final exposure time, which effectively eliminates the influence of the inconsistency between the CMOS adopted frequency and the stroboscopic frequency, thereby effectively reducing the possibility of screen flickering, wavy stripes, or unstable exposure in the captured video when the external light source is stroboscopic. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the implementation modes of the present application, the drawings required for use in the description of the implementation modes will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a schematic diagram of the implementation process of an anti-stroboscopic method provided in Example 1 of the present application;
[0019] Figure 2 This is a schematic diagram of the module composition of an anti-stroboscopic device provided in Example 2 of the present application;
[0020] Figure 3 It is a schematic diagram of the internal structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0021] The present application is further described in detail below in conjunction with the accompanying drawings and implementation methods. It is particularly noted that the following implementation methods are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following implementation methods are only some implementation methods of the present application rather than all implementation methods. All other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0022] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to these processes, methods, products or devices.
[0023] The above terms are only for the convenience of description and should not be construed as limitations on the present technical solution.
[0024] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0025] The specific implementation of the present application is described in detail below in conjunction with specific embodiments.
[0026] Embodiment 1.
[0027] Figure 1 The implementation process of an anti-stroboscopic method provided in the first embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown, which is described in detail as follows.
[0028] The target stroboscopic frequency detected by the automatic stroboscopic detection module is obtained, and a preliminary exposure time is calculated according to the target stroboscopic frequency.
[0029] It should be noted that the automatic strobe detection module is connected to the CPU chip of the camera, which can automatically detect the target strobe frequency of the light source and automatically adjust the exposure time of the camera according to the detected target strobe frequency. However, the problem is that some of the built-in automatic strobe detection modules are defective, the adjustable exposure range is limited, and sometimes fail; the exposure time recommended by the automatic strobe detection module does not take into account the movement state of the camera, and the exposure effect is poor in some cases; the measurement result of the automatic strobe detection module is unstable. The automatic strobe detection module is mainly realized by photometry technology and technology for analyzing strobe stripes in the image. The data itself has too much noise, so the measurement result is unstable. Therefore, the preliminary exposure time calculated by the automatic strobe detection module according to the target strobe frequency needs to be further processed to obtain a more accurate exposure time.
[0030] The cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time.
[0031] It should be noted that the cached exposure time is the smoothed exposure time at the previous moment, and the smoothed exposure time at the moment to be exposed is calculated by combining the smoothed exposure time at the previous moment and using an exposure smoothing algorithm, thereby reducing the influence of the unstable measurement result of the automatic stroboscopic detection module. The exposure smoothing algorithm includes but is not limited to a moving average method, a moving median method, and the like.
[0032] One specific implementation method is that the cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time, including: setting the current smoothed exposure time to EPsm(k), the cached exposure time to EPsm(k-1), and the current preliminary exposure time to EPs(k), then: EPsm(k)=k(ω)EPs(k)+(1-k(ω))EPsm(k-1), wherein k(ω) is a weighting parameter.
[0033] It should be noted that the k(ω) is a parameter related to the camera's own state, and is used to perform weighted calculation on the current preliminary exposure time and the cached exposure time according to the camera's own state. The k(ω) can be a function related to the camera's own state or a fixed value.
[0034] One specific implementation is that the k(ω) is a function related to the angular velocity ω of the camera, and the k(ω) satisfies: k(ω)=1-exp(-λ|ω|), wherein λ is the sensitivity coefficient of the camera.
[0035] It should be noted that k(ω) is a function related to the angular velocity ω of the camera, and the angular velocity ω is the camera posture data measured by the inertial measurement module of the camera. When the camera rotates faster, the angular velocity ω is larger, which indicates that the relative position change difference between the camera and the stroboscopic light source is larger. Therefore, the weight of the initial exposure time EPs(k) should be increased, and the weight of the cached exposure time EPsm(k-1) should be reduced.
[0036] Another feasible implementation is that k(ω) is a function related to the fusion data of the inertial sensor of the camera, and the acceleration, angular velocity and other posture data measured by the inertial sensor are fused and calculated to obtain a data function that more accurately reflects the camera motion posture.
[0037] The current motion state of the camera and the type of environment in which the camera is currently located are determined, and the maximum exposure time is determined according to the current motion state and the type of environment in which the camera is currently located.
[0038] It should be noted that the current motion state of the camera and the current environment are also important factors affecting the exposure time. Therefore, in order to further reduce the possibility of screen flickering, wavy stripes, or unstable exposure in the video shot due to the stroboscopic external light source, it is an urgent problem to be solved. It is necessary to combine the current motion state of the camera and the current environment type to further obtain the maximum exposure time, and adjust the smooth exposure time within the maximum exposure time.
[0039] One specific implementation is that determining the current motion state of the camera includes:
[0040] Obtaining the current attitude data of the camera, where the attitude data includes gyroscope data, and the current motion state includes a stationary state, a low-speed motion state, a fast motion state, and a high-speed motion state;
[0041] Performing fusion calculation on the gyroscope data to obtain a rotation vector, and quantifying the rotation vector through calculation into a definite value a within the 0-1 numerical interval;
[0042] When the definite value a after quantization of the rotation vector is 0, determining that the current motion state is the stationary state;
[0043] When the definite value a after quantization of the rotation vector is 0 < a ≤ 0.2, determining that the current motion state is the low-speed motion state;
[0044] When the definite value a after quantization of the rotation vector is 0.2 < a ≤ 0.5, determining that the current motion state is the fast motion state;
[0045] When the definite value a after quantization of the rotation vector is 0.5 < a ≤ 1, determining that the current motion state is the high-speed motion state.
[0046] It should be noted that the attitude data may also include accelerometer data and magnetometer data. Performing fusion calculation on the gyroscope data, the accelerometer data, and the magnetometer data to obtain the rotation vector, and quantifying the rotation vector through calculation into a definite value a within the 0-1 numerical interval. The definite value a reflects the current motion state of the camera, and the larger the definite value a, the more intense the current motion state of the camera.
[0047] One specific implementation is that determining the current environment type where the camera is located includes:
[0048] Obtaining the current sensitivity of the camera, and determining the current environment type according to the current sensitivity and the cached exposure time. The current environment type includes a bright environment, a dull environment, and a dark environment;
[0049] When the current sensitivity is less than or equal to 100 and the cached exposure time is less than or equal to 8 ms, determining that the current environment type is the bright environment;
[0050] When the current sensitivity is greater than 100 and less than or equal to 220, and the cached exposure time is greater than or equal to 10 ms and less than or equal to 30 ms, determining that the current environment type is the dull environment;
[0051] When the current sensitivity is greater than 220 and the buffered exposure time is greater than 30 ms, it is determined that the current environment type is a dark environment.
[0052] One specific implementation manner is that determining the maximum exposure time according to the current motion state and the current environment type includes:
[0053] When the current motion state is a low-speed motion state, the maximum exposure time is determined to be 10ms when the current environment type is a bright environment, the maximum exposure time is determined to be 15ms when the current environment type is a dim environment, and the maximum exposure time is determined to be 30ms when the current environment type is a dark environment;
[0054] When the current motion state is a fast motion state, the maximum exposure time is determined to be 6 ms when the current environment type is a bright environment, the maximum exposure time is determined to be 10 ms when the current environment type is a dim environment, and the maximum exposure time is determined to be 30 ms when the current environment type is a dark environment;
[0055] When the current motion state is a high-speed motion state, when the current environment type is a bright environment, the maximum exposure time is determined to be 4ms; when the current environment type is a dim environment, the maximum exposure time is determined to be 6ms; when the current environment type is a dark environment, the maximum exposure time is determined to be 30ms.
[0056] Within the maximum exposure time, the smoothing exposure time is adjusted according to the target stroboscopic frequency to obtain a final exposure time, and the camera is controlled to perform exposure according to the final exposure time during shooting.
[0057] One specific implementation method is that, within the maximum exposure time, adjusting the smoothed exposure time according to the target stroboscopic frequency to obtain the final exposure time includes:
[0058] When the target strobe frequency is 60 Hz, adjusting the smoothing exposure time to a maximum integer multiple of 8.33 ms within the maximum exposure time to obtain the final exposure time;
[0059] When the target strobe frequency is 50 Hz, the smoothing exposure time is adjusted to a maximum integer multiple of 10 ms within the maximum exposure time to obtain the final exposure time.
[0060] Embodiment 2.
[0061] Figure 2A schematic diagram of the module composition of an anti-stroboscopic device provided in the second embodiment of the present application is shown. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
[0062] An anti-stroboscopic device according to an embodiment of the present application comprises: a preliminary exposure time calculation module, the preliminary exposure time calculation module is used to obtain a target stroboscopic frequency detected by an automatic stroboscopic detection module, and calculate a preliminary exposure time according to the target stroboscopic frequency; a smoothing exposure time calculation module, the smoothing exposure time calculation module is used to obtain a cached exposure time, and perform exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain a smoothing exposure time; a maximum exposure time calculation module, the maximum exposure time calculation module is used to determine a current motion state of a camera, and determine a type of environment in which the camera is currently located, and determine a maximum exposure time according to the current motion state and the type of environment in which the camera is currently located; and a final exposure time determination module, the final exposure time determination module is used to adjust the smoothing exposure time according to the target stroboscopic frequency within the maximum exposure time to obtain a final exposure time, and control the camera to perform exposure according to the final exposure time during shooting.
[0063] An anti-stroboscopic device according to an embodiment of the present application is used to implement the anti-stroboscopic method provided in any specific implementation manner of the first embodiment of the present application:
[0064] The target stroboscopic frequency detected by the automatic stroboscopic detection module is obtained, and a preliminary exposure time is calculated according to the target stroboscopic frequency; the cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; the current motion state of the camera and the type of environment in which the camera is currently located are determined, and the maximum exposure time is determined according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, the smoothed exposure time is adjusted according to the target stroboscopic frequency to obtain a final exposure time, and the camera is controlled to expose according to the final exposure time during shooting.
[0065] It should be noted that each module in the above anti-stroboscopic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0066] It should be noted that, for technical details not fully described in this embodiment, reference may be made to the anti-stroboscopic method provided in any specific implementation manner in the above-mentioned embodiment 1, and will not be repeated here.
[0067] Embodiment three.
[0068] In an embodiment of the present application, a computer device is provided. Figure 3 A schematic diagram of the internal structure of a computer device.
[0069] The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the anti-stroboscopic method provided by any specific implementation method in the first embodiment of the present application when executing the computer program, specifically including:
[0070] The target stroboscopic frequency detected by the automatic stroboscopic detection module is obtained, and a preliminary exposure time is calculated according to the target stroboscopic frequency; the cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; the current motion state of the camera and the type of environment in which the camera is currently located are determined, and the maximum exposure time is determined according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, the smoothed exposure time is adjusted according to the target stroboscopic frequency to obtain a final exposure time, and the camera is controlled to expose according to the final exposure time during shooting.
[0071] It should be noted that the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a video generation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0072] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0073] It should be noted that, for technical details not described in detail in this embodiment, reference may be made to the anti-stroboscopic method provided in any specific implementation manner in the above-mentioned embodiment 1, and will not be repeated here.
[0074] Embodiment 4.
[0075] In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the anti-stroboscopic method provided by any specific implementation method in the first embodiment of the present application is implemented, specifically including:
[0076] The target stroboscopic frequency detected by the automatic stroboscopic detection module is obtained, and a preliminary exposure time is calculated according to the target stroboscopic frequency; the cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; the current motion state of the camera and the type of environment in which the camera is currently located are determined, and the maximum exposure time is determined according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, the smoothed exposure time is adjusted according to the target stroboscopic frequency to obtain a final exposure time, and the camera is controlled to expose according to the final exposure time during shooting.
[0077] It should be noted that, for technical details not described in detail in this embodiment, reference may be made to the anti-stroboscopic method provided in any specific implementation manner in the above-mentioned embodiment 1, and will not be repeated here.
[0078] Different from the prior art, the embodiments of the present application provide an anti-stroboscopic method, apparatus, computer device and storage medium, wherein the anti-stroboscopic method includes:
[0079] The target stroboscopic frequency detected by the automatic stroboscopic detection module is obtained, and a preliminary exposure time is calculated according to the target stroboscopic frequency; the cached exposure time is obtained, and exposure smoothing calculation is performed according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time; the current motion state of the camera and the type of environment in which the camera is currently located are determined, and the maximum exposure time is determined according to the current motion state and the type of environment in which the camera is currently located; within the maximum exposure time, the smoothed exposure time is adjusted according to the target stroboscopic frequency to obtain a final exposure time, and the camera is controlled to expose according to the final exposure time during shooting.
[0080] It can be seen from the above technical scheme that the embodiments of the present application have the following advantages: a preliminary exposure time is calculated according to the target stroboscopic frequency detected by the automatic stroboscopic detection module, and then the exposure smoothing calculation is performed in combination with the cached exposure time to obtain a smoothed exposure time. Finally, the maximum exposure time is determined according to the current motion state of the camera and the type of environment in which the camera is currently located. The smoothed exposure time is further adjusted within this maximum exposure time to obtain the final exposure time. Exposure is performed according to the final exposure time, which effectively eliminates the influence of the inconsistency between the CMOS adopted frequency and the stroboscopic frequency, thereby effectively reducing the possibility of screen flickering, wavy stripes, or unstable exposure in the captured video when the external light source is stroboscopic.
[0081] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0082] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0083] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a terminal device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0084] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An anti-stroboscopic method, characterized in that: The method includes: Obtaining a target stroboscopic frequency detected by an automatic stroboscopic detection module, and calculating a preliminary exposure time according to the target stroboscopic frequency; Obtaining a cached exposure time, and performing exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time, where the cached exposure time is the smoothed exposure time at the previous moment; Determining the current motion state of the camera and determining the type of environment where the camera is currently located, and determining a maximum exposure time according to the current motion state and the type of environment where the camera is currently located; Within the maximum exposure time, adjusting the smoothed exposure time according to the target stroboscopic frequency to obtain a final exposure time, and controlling the camera to perform exposure according to the final exposure time during the shooting process.
2. An anti-stroboscopic method according to claim 1, characterized in that: The obtaining the cached exposure time, and performing exposure smoothing calculation according to the cached exposure time and the preliminary exposure time to obtain a smoothed exposure time includes: Setting the current smoothed exposure time as EPsm(k), the cached exposure time as EPsm(k - 1), and the current preliminary exposure time as EPs(k), then it satisfies: EPsm(k)=k(ω)EPs(k)+(1 - k(ω))EPsm(k - 1), where k(ω) is a weighting parameter.
3. An anti-stroboscopic method according to claim 2, characterized in that: The k(ω) is a function related to the angular velocity ω of the camera, and the k(ω) satisfies: k(ω)=1 - exp(-λ|ω|), where λ is the sensitivity coefficient of the camera.
4. The anti-stroboscopic method according to claim 1, characterized in that: The adjusting the smoothed exposure time according to the target stroboscopic frequency within the maximum exposure time to obtain a final exposure time includes: When the target stroboscopic frequency is 60Hz, adjusting the smoothed exposure time to the largest integer multiple of 8.33ms within the maximum exposure time to obtain the final exposure time; When the target stroboscopic frequency is 50Hz, adjusting the smoothed exposure time to the largest integer multiple of 10ms within the maximum exposure time to obtain the final exposure time.
5. An anti-stroboscopic method according to any one of claims 1 to 4, characterized in that: The determining the current motion state of the camera includes: Obtaining the current attitude data of the camera, where the attitude data includes gyroscope data, and the current motion state includes a stationary state, a low-speed motion state, a fast motion state, and a high-speed motion state; Performing fusion calculation on the gyroscope data to obtain a rotation vector, and quantifying the rotation vector through calculation into a determined value a within the numerical interval of 0 - 1; When the determined value a after quantization of the rotation vector is 0, determining the current motion state as the stationary state; When the determined value a after quantization of the rotation vector is 0 < a ≤ 0.2, determining the current motion state as the low-speed motion state; When the determined value a after quantization of the rotation vector is 0.2 < a ≤ 0.5, determining the current motion state as the fast motion state; When the determined value a after quantization of the rotation vector is 0.5 < a ≤ 1, determining the current motion state as the high-speed motion state.
6. The anti-stroboscopic method according to claim 5, characterized in that: The determining the type of environment where the camera is currently located includes: Acquire the current sensitivity of the camera, and determine the type of the current environment according to the current sensitivity and the cached exposure time, where the type of the current environment includes a bright environment, a dim environment, and a dark environment; When the current sensitivity is less than or equal to 100 and the cached exposure time is less than or equal to 8 ms, determining that the current environment type is a bright environment; When the current sensitivity is greater than 100 and less than or equal to 220, and the cached exposure time is greater than or equal to 10 ms and less than or equal to 30 ms, it is determined that the current environment type is a dark environment; When the current sensitivity is greater than 220 and the buffered exposure time is greater than 30 ms, it is determined that the current environment type is a dark environment.
7. The anti-stroboscopic method according to claim 6, wherein determining the maximum exposure time according to the current motion state and the current environment type comprises: When the current motion state is a low-speed motion state, the maximum exposure time is determined to be 10ms when the current environment type is a bright environment, the maximum exposure time is determined to be 15ms when the current environment type is a dim environment, and the maximum exposure time is determined to be 30ms when the current environment type is a dark environment; When the current motion state is a fast motion state, the maximum exposure time is determined to be 6 ms when the current environment type is a bright environment, the maximum exposure time is determined to be 10 ms when the current environment type is a dim environment, and the maximum exposure time is determined to be 30 ms when the current environment type is a dark environment; When the current motion state is a high-speed motion state, when the current environment type is a bright environment, the maximum exposure time is determined to be 4ms; when the current environment type is a dim environment, the maximum exposure time is determined to be 6ms; when the current environment type is a dark environment, the maximum exposure time is determined to be 30ms.
8. An anti-stroboscopic device, characterized in that: The anti-stroboscopic device comprises: A preliminary exposure time calculation module, the preliminary exposure time calculation module is used to obtain the target stroboscopic frequency detected by the automatic stroboscopic detection module, and calculate the preliminary exposure time according to the target stroboscopic frequency; A smoothing exposure time calculation module, the smoothing exposure time calculation module is used to obtain a cached exposure time, perform exposure smoothing calculation according to the cached exposure time and the preliminary exposure time, and obtain a smoothing exposure time, wherein the cached exposure time is the smoothing exposure time at the previous moment; A maximum exposure time calculation module, the maximum exposure time calculation module is used to determine the current motion state of the camera and the type of environment the camera is currently in, and determine the maximum exposure time according to the current motion state and the type of environment the camera is currently in; A final exposure time determination module is used to adjust the smoothing exposure time according to the target stroboscopic frequency within the maximum exposure time to obtain a final exposure time, and control the camera to expose according to the final exposure time during shooting.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the anti-stroboscopic method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the anti-stroboscopic method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Photographing method and device, storage medium and mobile terminal
CN109120863A
Shooting method and device, computer equipment and storage medium
CN114245026A