Video shooting method and apparatus
By controlling the video shooting equipment with frame intervals that are integer multiples of half a cycle of the power frequency, the problem of power frequency flicker was solved, and high-quality video shooting effects were achieved.
Patent Information
- Application Number
- CN202310410395.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-04-12
AI Technical Summary
In existing technologies, frame rate control methods result in power frequency flicker in the video, affecting the shooting effect.
By acquiring the target frame rate and power frequency of the target shooting device, the first frame interval and the second frame interval, which are integer multiples of half a cycle of the power frequency, are determined. Based on these intervals, the image capture of the shooting device is controlled to ensure that the frame interval between every two adjacent frames is an integer multiple of half a cycle of the power frequency.
The problem of power frequency flicker has been solved, ensuring that the video shooting effect is not affected, meeting the frame rate requirements and reducing the fluctuation of frame interval time.
Smart Images

Figure CN116546334B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of video, in particular to a video shooting method and device. BACKGROUND
[0002] Frame rate is one of the important parameters of a video, and the frame rate control method in the prior art is to control a shooting device to shoot a frame of image every average frame interval under the condition that the target frame rate is N, so as to obtain a video with a frame rate of N, and the frame interval between any two adjacent frames in the video is equal. Although this shooting method can control the video frame rate of the shooting device, it cannot guarantee that the frame interval is an integer multiple of the frame number of a half cycle of power frequency. In the case where the frame interval is not an integer multiple of the frame number of a half cycle of power frequency, the problem of power frequency flicker occurs, which affects the video shooting effect. Therefore, the related art has the problem that the shot video has power frequency flicker, thereby affecting the video shooting effect.
[0003] In view of the problem in the related art that the shot video has power frequency flicker, thereby affecting the video shooting effect, no effective solution has been proposed so far. SUMMARY
[0004] Embodiments of the present application provide a video shooting method and device to at least solve the problem in the related art that the shot video has power frequency flicker, thereby affecting the video shooting effect.
[0005] According to an embodiment of the present application, a video shooting method is provided, which comprises: acquiring a target frame rate N of a target shooting device and a power frequency of the target shooting device, wherein the target frame rate N is used to represent the number of frames of images shot per second by the target shooting device, and N is an integer greater than or equal to 2; determining a half cycle of power frequency according to the power frequency; determining a first frame interval and a second frame interval according to the target frame rate and the half cycle of power frequency, wherein the first frame interval and the second frame interval are both an integer multiple of the half cycle of power frequency; controlling the target shooting device to shoot an i-th group of images in the i-th second according to the first frame interval and the second frame interval, wherein the i-th group of images comprises N frames of images shot in the i-th second, the frame interval between any two adjacent frames in the N frames of images is the first frame interval or the second frame interval, and i is an integer greater than or equal to 1.
[0006] In an example embodiment, the determining the first frame interval and the second frame interval according to the target frame rate and the half cycle of the power frequency comprises: determining an average frame interval of the target shooting device as 1 / N second when the frame rate of the target shooting device is the target frame rate; determining the first frame interval as a largest frame interval in a first frame interval set when the half cycle of the power frequency is M millisecond and the average frame interval is not an integer multiple of the half cycle of the power frequency, wherein the frame intervals in the first frame interval set are less than the average frame interval and are integer multiples of the half cycle of the power frequency, and wherein M is equal to 1 or M is a positive integer greater than or equal to 2; and determining the second frame interval as a smallest frame interval in a second frame interval set when the half cycle of the power frequency is M millisecond and the average frame interval is not an integer multiple of the half cycle of the power frequency, wherein the frame intervals in the second frame interval set are greater than the average frame interval and are integer multiples of the half cycle of the power frequency.
[0007] In an example embodiment, the controlling the target shooting device to shoot the i-th group of images in the i-th second according to the first frame interval and the second frame interval comprises: determining a first number and a second number according to the first frame interval and the second frame interval, wherein the first number is used to represent a frame number of images with the first frame interval per second, and the second number is used to represent a frame number of images with the second frame interval per second; controlling the target shooting device to shoot a-th image in the i-th group of images every the first frame interval, and controlling the target shooting device to shoot b-th image in the i-th group of images every the second frame interval, wherein a is the first number and b is the second number.
[0008] In an example embodiment, the determining the first number and the second number according to the first frame interval and the second frame interval comprises: determining the first number and the second number satisfying a preset condition, wherein the preset condition comprises: a sum of the first number and the second number is equal to N; and a product of the first number and the first frame interval plus a product of the second number and the second frame interval is equal to 1s.
[0009] In an example embodiment, the controlling the target photographing device to photograph the a-th image in the i-th group of images every the first frame interval and the b-th image in the i-th group of images every the second frame interval comprises: setting a photographing interval of the target photographing device to the first frame interval, and controlling the target photographing device to photograph the first a-th image in the i-th group of images every the first frame interval; in a case that the target photographing device photographs the a-th image, adjusting the photographing interval of the target photographing device from the first frame interval to the second frame interval, and controlling the target photographing device to photograph the last b-th image in the i-th group of images every the second frame interval.
[0010] In an example embodiment, after the controlling the target photographing device to photograph the last b-th image in the i-th group of images every the second frame interval, the method further comprises: controlling the target photographing device to photograph the first b-th image in the i+1-th group of images every the second frame interval; in a case that the target photographing device photographs the b-th image in the i+1-th group of images, adjusting the photographing interval of the target photographing device from the second frame interval to the first frame interval, and controlling the target photographing device to photograph the last a-th image in the i+1-th group of images every the first frame interval.
[0011] In an example embodiment, the method further comprises: before the target photographing device photographs the j-th image in the i-th group of images, acquiring a first exposure time when the target photographing device photographs a previous image of the j-th image, and a photographing interval of the target photographing device after the target photographing device photographs the previous image, wherein the photographing interval is an interval between two adjacent images photographed by the target photographing device; in a case that the first exposure time is greater than the photographing interval, adjusting an exposure time of the target photographing device from the first exposure time to a second exposure time, wherein the second exposure time is equal to the photographing interval; adjusting a gain of the target photographing device from a first gain corresponding to the first exposure time to a second gain corresponding to the second exposure time; in a case that photographing parameters of the target photographing device include the second exposure time and the second gain, controlling the target photographing device to photograph the j-th image, wherein j is an integer greater than or equal to 1, and j and i are not equal to 1 at the same time.
[0012] In an example embodiment, determining the power frequency half cycle according to the power frequency comprises: in a case that the power frequency is S hertz, determining the power frequency half cycle as seconds.
[0013] According to still another embodiment of the present application, a video shooting device is also provided, comprising: an acquisition module configured to acquire a target frame rate N of a target shooting device and a power frequency of the target shooting device, wherein the target frame rate N is used to represent a number of frames of images shot per second by the target shooting device, and N is an integer greater than or equal to 2; a first determination module configured to determine a power frequency half cycle according to the power frequency; a second determination module configured to determine a first frame interval and a second frame interval according to the target frame rate and the power frequency half cycle, wherein the first frame interval and the second frame interval are both integer multiples of the power frequency half cycle; and a control module configured to control the target shooting device to shoot an ith group of images in the ith second according to the first frame interval and the second frame interval, wherein the ith group of images comprises N frames of images shot in the ith second, a frame interval between any two adjacent frames of the N frames of images is the first frame interval or the second frame interval, and i is an integer greater than or equal to 1.
[0014] According to still another embodiment of the present application, a computer readable storage medium is also provided, wherein the computer readable storage medium stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.
[0015] According to still another embodiment of the present application, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.
[0016] According to the present application, after the first frame interval and the second frame interval which are integer multiples of the power frequency half cycle are determined according to the target frame rate and the power frequency, the target shooting device is controlled to shoot the ith group of images in the ith second according to the first frame interval and the second frame interval, so that N images are shot in the ith second, and a frame interval between any two adjacent frames is the first frame interval or the second frame interval, i.e., a frame rate corresponding to the ith second is the target frame rate, and a frame interval between any two adjacent frames is an integer multiple of the power frequency half cycle, so that the video shot by the target shooting device meets the requirement of the frame rate, and power frequency flicker does not occur, and the video shooting effect is not affected, thereby solving the problem of power frequency flicker in the video shot in the related art, and affecting the video shooting effect, and achieving the effect that the video shot does not have power frequency flicker. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 is a mobile terminal hardware structure block diagram of a video shooting method according to an embodiment of the present application;
[0018] Figure 2 is a flowchart of a video shooting method according to an embodiment of the present application;
[0019] Figure 3 is a flowchart of a video shooting method according to an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of a shot image frame according to an embodiment of the present application;
[0021] Figure 5 is a structural block diagram of a video shooting device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0023] It should be noted that the terms "first", "second", and the like in the description of the present application and the claims and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0024] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the case of running on a mobile terminal, Figure 1 is a structural block diagram of a mobile terminal for a video shooting method according to an embodiment of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processors 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal can further include a transmission device 106 for communication function and an input / output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can further include more or less components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .
[0025] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the video shooting method in the embodiments of the present application. The processor 102 can execute various functional applications and data processing, i.e., implement the above method, by running the computer programs stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0026] The transmission device 106 is configured to receive or send data via a network. Specific examples of the above network can include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0027] In the embodiments, a video shooting method is provided, Figure 2 The flowchart of the video shooting method according to the embodiments of the present application is shown in FIG. 2, which includes the following steps: Figure 2
[0028] In step S202, a target frame rate N of a target shooting device and a power frequency of the target shooting device are obtained, wherein the target frame rate N is used to represent the number of frames of images shot per second by the target shooting device, and N is an integer greater than or equal to 2.
[0029] In step S204, a power frequency half cycle is determined according to the power frequency.
[0030] In step S206, a first frame interval and a second frame interval are determined according to the target frame rate and the power frequency half cycle, wherein the first frame interval and the second frame interval are both integer multiples of the power frequency half cycle.
[0031] In step S208, the first interval and the second interval are used to control the target shooting device to shoot the i-th set of images in the i-th second, where the i-th set of images includes N frames of images shot in the i-th second, and the interval between any two adjacent frames of the N frames of images is the first interval or the second interval, and i is an integer greater than or equal to 1.
[0032] In this embodiment, the target frame rate of the target shooting device is generally pre-set, and is used to indicate that the frame rate of the video expected to be shot by the target shooting device is the target frame rate. When the target frame rate is N, it indicates that the number of frames of images shot by the target shooting device per second is N. The power frequency of the target shooting device is the rated frequency of power generation, power transmission, power transformation and distribution equipment and industrial and civil electrical equipment of a power frequency power system.
[0033] After the power frequency is obtained, the power frequency period is determined according to the power frequency, and the power frequency half period is half of the power frequency period.
[0034] The first interval and the second interval that are integer multiples of the power frequency half period are determined according to the target frame rate of the target shooting device and the power frequency half period, and the target shooting device is controlled to shoot images according to the first interval and the second interval. A set of images is shot per second, and the first set of images shot per second includes N frames of images, and when the N frames of images are shot, the next frame of image is shot after a first interval or each second interval after a frame of image is shot, so that the interval between any two adjacent frames of images shot by the target shooting device is the first interval or the second interval.
[0035] Through the above steps, after the first interval and the second interval that are integer multiples of the power frequency half period are determined according to the target frame rate and the power frequency, the i-th set of images in the i-th second is obtained by controlling the target shooting device to shoot according to the first interval and the second interval, so that N images are shot in the i-th second, and the interval between any two adjacent frames of images is the first interval or the second interval, that is, the frame rate corresponding to the i-th second is the target frame rate, and the interval between any two adjacent frames of images is an integer multiple of the power frequency half period. The video shot by the target shooting device meets the requirement of the frame rate, and does not have power frequency flicker, and does not affect the video shooting effect, thereby solving the problem that the video shot in the related art has power frequency flicker, which affects the video shooting effect, and achieving the effect that the video shot does not have power frequency flicker.
[0036] In an optional embodiment, the determining the first frame interval and the second frame interval according to the target frame rate and the half cycle of the power frequency comprises: in a case that the frame rate of the target shooting device is the target frame rate, determining an average frame interval of the target shooting device as 1 / N second; in a case that the half cycle of the power frequency is M milliseconds and the average frame interval is not an integer multiple of the half cycle of the power frequency, determining the first frame interval as a largest frame interval in a first frame interval set, wherein the frame intervals in the first frame interval set are less than the average frame interval and are integer multiples of the half cycle of the power frequency, wherein M is equal to 1 or M is a positive number greater than or equal to 2; in a case that the half cycle of the power frequency is M milliseconds and the average frame interval is not an integer multiple of the half cycle of the power frequency, determining the second frame interval as a smallest frame interval in a second frame interval set, wherein the frame intervals in the second frame interval set are greater than the average frame interval and are integer multiples of the half cycle of the power frequency.
[0037] In the embodiment, the power frequency is generally constant, and thus the half cycle of the power frequency is also generally constant, which is denoted as M. In a case that the shooting frame rate is N, if the frame intervals between every two adjacent frames are equal, the frame interval between every two adjacent frames, i.e., the average frame interval, is 1 / N second (1000 / N milliseconds). In a case that the average frame interval 1000 / N milliseconds is not an integer multiple of the half cycle of the power frequency M milliseconds, the first frame interval and the second frame interval according to the integer multiple of the half cycle of the power frequency M milliseconds are needed.
[0038] The first frame interval is obtained by aligning the average frame interval to the half cycle of the power frequency downward, and the obtained first frame interval is the largest frame interval which is an integer multiple of the half cycle of the power frequency and is less than the average frame interval. In other words, among the frame intervals which are integer multiples of the half cycle of the power frequency and are less than the average frame interval, the first frame interval is the largest. The first frame interval set includes the frame intervals which are integer multiples of the half cycle of the power frequency and are less than the average frame interval, and the largest frame interval in the first frame interval set is determined as the first frame interval.
[0039] Optionally, the determining the first frame interval by aligning the average frame interval to the half cycle of the power frequency downward comprises: determining the first frame interval by the following formula:
[0040] ALGIN_DOWN(c,d)=(c / d)*d, wherein c / d represents the quotient of c divided by d.
[0041] Taking the target frame rate as 15 frames and the power frequency as 50 Hz as an example, the average frame interval is:
[0042]
[0043] A half cycle of the power frequency is:
[0044]
[0045] Therefore, the first frame interval is ALGIN_DOWN(Frm, M) = (66.666 / 10)*10, wherein the output result of 66.666 / 10 is 6, and therefore the output result of (66.666 / 10)*10 is 60, that is, the first frame interval is determined as 60 ms.
[0046] The second frame interval is obtained by aligning the average frame interval to a half cycle of the power frequency, and the second frame interval obtained is the smallest frame interval that is an integer multiple of the half cycle of the power frequency among frame intervals greater than the average frame interval, in other words, among frame intervals that are integer multiples of the half cycle of the power frequency and greater than the average frame interval, the second frame interval is the smallest, that is, the second frame interval set includes frame intervals that are integer multiples of the half cycle of the power frequency and greater than the average frame interval, and the smallest frame interval in the second frame interval set is determined as the second frame interval.
[0047] Optionally, the second frame interval is determined by aligning the average frame interval to a half cycle of the power frequency in a downward manner, and the second frame interval is determined by the following formula:
[0048] Frm1 = ALGIN_UP(c, d) = ((c + d - 1) / d)*d, wherein (c + d - 1) / d represents the quotient of (c + d - 1) divided by d.
[0049] Taking a target frame rate of 15 frames and a power frequency of 50 Hz as an example:
[0050] The second frame interval is Frm2 = ALGIN_UP(Frm, M) = ((66.666 + 10 - 1) / 10)*10, wherein the output result of (66.666 + 10 - 1) / 10 is 7, and therefore the output result of ((66.666 + 10 - 1) / 10)*10 is 70, that is, the second frame interval is determined as 70 ms.
[0051] The first frame interval and the second frame interval determined by the above method not only ensure that the frame interval of adjacent image frames captured by the target shooting device is an integer multiple of a half cycle of the power frequency, but also reduce the frame interval time fluctuation coefficient relative to the existing scheme of changing the frame interval by discarding frames, thereby improving the flow degree of the video.
[0052] It should be noted that the fluctuation coefficient K = (maximum frame interval - minimum frame interval) / minimum frame interval. Taking discarding only one frame of image as an example, the fluctuation coefficient K = 1, and taking the first frame interval determined above as 60 ms and the second frame interval as 70 ms as an example, the fluctuation coefficient K = 0.17, and the fluctuation coefficient is greatly reduced.
[0053] In an example embodiment, the controlling the target photographing device to photograph the i-th set of images in the i-th second according to the first frame interval and the second frame interval comprises: determining a first quantity and a second quantity according to the first frame interval and the second frame interval, wherein the first quantity is used to represent the number of frames of images with the first frame interval per second, and the second quantity is used to represent the number of frames of images with the second frame interval per second; controlling the target photographing device to photograph a frame of images in the i-th set of images every the first frame interval, and controlling the target photographing device to photograph another frame of images in the i-th set of images every the second frame interval, wherein a is the first quantity, and b is the second quantity.
[0054] In the embodiment, when the i-th set of images is photographed according to the first frame interval and the second frame interval, in order to ensure that the number of frames of images photographed in 1s is N, the number of frames of images with the first frame interval (the first quantity a) in the N frames of images and the number of frames of images with the second frame interval (the second quantity b) in the N frames of images need to be determined first. When the i-th set of images is controlled to be photographed, a frame of images with the first frame interval is controlled to be photographed by the target photographing device, and b frames of images with the second frame interval are controlled to be photographed by the target photographing device.
[0055] In an example embodiment, the determining the first quantity and the second quantity according to the first frame interval and the second frame interval comprises: determining the first quantity and the second quantity that satisfy a preset condition, wherein the preset condition comprises: the sum of the first quantity and the second quantity is equal to N; and the product of the first quantity and the first frame interval plus the product of the second quantity and the second frame interval is equal to 1s.
[0056] In the embodiment, the target frame rate of the target photographing device is N, and the number of frames that need to be photographed per second is N. In addition, the sum of the frame intervals corresponding to all the images in the N frames of images should be 1s. In the N frames of images, there are a frames of images with the first frame interval, and there are b frames of images with the second frame interval. Therefore, the product of the first quantity and the first frame interval plus the product of the second quantity and the second frame interval is equal to 1s.
[0057] According to the two conditions that the sum of the first quantity a and the second quantity b is equal to N, and the product of the first quantity and the first frame interval plus the product of the second quantity and the second frame interval is equal to 1s, the first quantity and the second quantity can be determined.
[0058] Optionally, the first quantity and the second quantity are determined by the following formula:
[0059]
[0060] wherein, Frm1 is the first frame interval, and Frm2 is the second frame interval.
[0061] Taking the first frame interval Frm1 as 60 ms, the second frame interval Frm2 as 70 ms, and N as 15 as an example, the first quantity a and the second quantity b satisfy the following formula
[0062]
[0063] It is calculated that a=5 and b=10, that is, in the ith group of images photographed by the target photographing device within the is, there are 5 images with the first frame interval and 10 images with the second frame interval.
[0064] It should be noted that the frame interval between the current frame and the next frame image is the first frame interval, and the frame interval of the current frame image is the first frame interval, that is, the current image is an image with the first frame interval. The frame interval between the current frame and the next frame image is the second frame interval, and the frame interval of the current frame image is the second frame interval, that is, the current image is an image with the second frame interval.
[0065] In an example embodiment, the control of the target photographing device to photograph a frames of images in the ith group of images every first frame interval and the control of the target photographing device to photograph b frames of images in the ith group of images every second frame interval comprises: setting the photographing interval of the target photographing device to the first frame interval, and controlling the target photographing device to photograph the first a frames of images in the ith group of images every first frame interval; in the case that the target photographing device photographs the first a frames of images, adjusting the photographing interval of the target photographing device from the first frame interval to the second frame interval, and controlling the target photographing device to photograph the last b frames of images in the ith group of images every second frame interval.
[0066] In the embodiment, when the target photographing device photographs images, images are photographed according to the set photographing interval of the target photographing device. Before photographing images with the first frame interval, the photographing interval of the target photographing device needs to be set to the first frame interval. Before photographing images with the second frame interval, the photographing interval of the target photographing device needs to be set to the second frame interval.
[0067] In order to reduce the number of times of adjusting the photographing interval of the target photographing device, a frames of images with the first frame interval are set to be continuously photographed, and b frames of images with the second frame interval are set to be continuously photographed.
[0068] In the photographing of the i-th group of images, the photographing interval of the target photographing device is first set to a first frame interval, the target photographing device is controlled to continuously photograph a front a-th frame of images, in the case that the photographing of the front a-th frame of images is completed, i.e. the photographing of the b-th frame of images in the i-th group of images is completed, the photographing interval of the target photographing device is adjusted to a second frame interval, the target photographing device is controlled to continuously photograph a rear b-th frame of images, thus the photographing interval of the front a-th frame of images in the i-th group of images is the first frame interval, and the photographing interval of the rear b-th frame of images is the second frame interval.
[0069] Optionally, in the photographing of the i-th group of images, the photographing interval of the target photographing device can also be set to the second frame interval, the target photographing device is controlled to continuously photograph a front b-th frame of images, in the case that the photographing of the front a-th frame of images is completed, i.e. the photographing of the b-th frame of images in the i-th group of images is completed, the photographing interval of the target photographing device is adjusted to the second frame interval, the target photographing device is controlled to continuously photograph a rear a-th frame of images, thus the photographing interval of the front b-th frame of images in the i-th group of images is the second frame interval, and the photographing interval of the rear a-th frame of images is the first frame interval.
[0070] In one exemplary embodiment, after the control of the target photographing device to photograph the rear b-th frame of images in the i-th group of images every second frame interval, the method further comprises: controlling the target photographing device to photograph a front b-th frame of images in the i+1-th group of images every second frame interval; in the case that the photographing of the b-th frame of images in the i+1-th group of images is completed, adjusting the photographing interval of the target photographing device from the second frame interval to the first frame interval, and controlling the target photographing device to photograph a rear a-th frame of images in the i+1-th group of images every first frame interval.
[0071] In the present embodiment, after the control of the target photographing device to photograph the rear b-th frame of images in the i-th group of images every second frame interval, the photographing interval of the target photographing device is not adjusted, and the photographing interval of the target photographing device is still maintained as the second frame interval, the target photographing device is controlled to photograph a front b-th frame of images in the i+1-th group of images, in the case that the photographing of the b-th frame of images in the i+1-th group of images is completed, i.e. the photographing of the b-th frame of images in the i+1-th group of images is completed, the photographing interval of the target photographing device is adjusted to the first frame interval, and the target photographing device is controlled to continuously photograph a rear a-th frame of images.
[0072] Through the present embodiment, the number of times of adjusting the photographing interval of the target photographing device is further reduced.
[0073] Optionally, if the target photographing device is controlled to continuously photograph a front a frames of images at a first frame interval and a rear b frames of images at a second frame interval when photographing the i-th group of images, after the target photographing device photographs the rear a frames of images in the i-th group of images, the photographing interval of the target photographing device is not adjusted, and the photographing interval of the target photographing device is still maintained as the first frame interval. After the target photographing device photographs the front a frames of images in the i+1-th group of images (i.e., in the case that the target photographing device photographs the a-th frame of images in the i+1-th group of images), the photographing interval of the target photographing device is adjusted to the second frame interval, and the target photographing device is controlled to continuously photograph the rear b frames of images.
[0074] In an example embodiment, the method further comprises: before the target photographing device photographs the j-th frame of images in the i-th group of images, acquiring a first exposure time at which the target photographing device photographs a previous frame of images of the j-th frame of images, and a photographing interval of the target photographing device after the target photographing device photographs the previous frame of images, wherein the photographing interval is an interval between two adjacent frames of images photographed by the target photographing device; in the case that the first exposure time is greater than the photographing interval, adjusting an exposure time of the target photographing device from the first exposure time to a second exposure time, wherein the second exposure time is equal to the photographing interval; adjusting a gain of the target photographing device from a first gain corresponding to the first exposure time to a second gain corresponding to the second exposure time; in the case that the photographing parameter of the target photographing device comprises the second exposure time and the second gain, controlling the target photographing device to photograph the j-th frame of images, wherein j is an integer greater than or equal to 1, and j and i are not simultaneously equal to 1.
[0075] In the embodiment, when the target photographing device photographs images, in addition to the photographing interval of the target photographing device needing to be adjusted, the photographing parameter (including the exposure time and the gain) of the target photographing device is judged whether the target exposure time and the gain need to be adjusted after each frame of image is photographed.
[0076] After the j-th previous frame of images is photographed, the first exposure time is acquired, which can be the exposure time of the target photographing device when the j-th previous frame of images is photographed. At the same time, after the j-th previous frame of images is photographed, the photographing interval of the target photographing device is the same as or different from the photographing interval before the j-th previous frame of images is photographed. After the j-th previous frame of images is photographed, the photographing interval of the target photographing device is acquired. The photographing interval of the target photographing device is the first frame interval or the second frame interval.
[0077] When the jth image is captured, the exposure time of the target photographing device should be less than or equal to the photographing interval of the target photographing device, therefore, if the first exposure time is greater than the photographing interval of the target photographing device after the (j-1)th image is captured, the exposure time of the target photographing device is adjusted to be consistent with the photographing interval, that is, the exposure time of the target photographing device is adjusted from the first exposure time to a second exposure time, wherein the second exposure time is equal to the photographing interval.
[0078] The exposure time of the target photographing device is adjusted from the first exposure time to the second exposure time, and the decrease of the exposure time will make the captured image darker, in order to keep the brightness of the jth image and the (j-1)th image unchanged, the gain of the target photographing device is adjusted.
[0079] The gain of the target photographing device is adjusted from a first gain corresponding to the first exposure time to a second gain corresponding to the second exposure time.
[0080] Optionally, the second gain is determined by the following formula:
[0081] Gain'=10 Gain / 20 *(Expo-VTS) / Expo
[0082] Wherein, Gain' is the second gain, Gain is the first gain, Expo is the first exposure time, VTS is the photographing interval, and Expo is greater than VTS.
[0083] When the photographing parameters of the target photographing device include the second exposure time and the second gain, the target photographing device is controlled to capture the jth image, wherein j is an integer greater than or equal to 1, and j and i are not equal to 1 at the same time.
[0084] When j and i are equal to 1 at the same time, a third exposure time set initially and a first photographing interval set initially are obtained, when the third exposure time is greater than the first photographing interval, the exposure time of the target photographing device is adjusted from the third exposure time to a fourth exposure time, the fourth exposure time is equal to the first photographing interval, the gain of the target photographing device is adjusted from a third gain corresponding to the third exposure time to a fourth gain corresponding to the fourth exposure time, and the first image in the first group of images is captured.
[0085] In an exemplary embodiment, the half cycle of the power frequency is determined according to the power frequency, comprising: when the power frequency is S hertz, the half cycle of the power frequency is determined as seconds.
[0086] Obviously, the above-described embodiments are only a part of the embodiments of the present application, not all the embodiments.
[0087] The application will be described in detail below with reference to the embodiments.
[0088] Figure 3 is a flowchart of a video shooting method according to an embodiment of the application, as shown in the figure, comprising: Figure 3
[0089] Step 301, obtaining a current exposure parameter;
[0090] The current exposure parameter comprises a current exposure time expo and a current gain Gain;
[0091] Step 302, calculating a first frame interval Frm1, a second frame interval Frm2, a first number a, and a second number b;
[0092] According to the power frequency, a power frequency half cycle M is calculated, and in the case that the frame rate of the target shooting device is the target frame rate, the average frame interval of the target shooting device is determined as 1 / N second. The first frame interval is determined by aligning the average frame interval to the power frequency half cycle in a downward manner, and the second frame interval is obtained by aligning the average frame interval to the power frequency half cycle in an upward manner.
[0093] The first number a and the second number b are determined by the following formula:
[0094]
[0095] Wherein, Frm1 is the first frame interval, and Frm2 is the second frame interval.
[0096] Step 303, determining whether FrmCnt is equal to 0, i.e., whether the current frame is the first frame of shooting. In the case that the determination result is yes, step 304 is executed, otherwise step 305 is executed.
[0097] Whether the current frame is the first frame of shooting is determined by whether the frame count is equal to 0. For example, FrmCnt=0 indicates that the current frame is the first frame.
[0098] Step 304, setting FrmCnt=a; VTS=Frm1, T=T1=2a, i.e., determining the frame count FrmCnt as the first number, determining the shooting interval VTS of the target shooting device as the first frame interval, setting the target threshold T of the continuous shooting frame interval as the first threshold of the image of the first frame interval, and then executing step 305;
[0099] In the case that the current frame is the first frame, the frame count is updated as the first number a, the shooting interval is set as the first frame interval Frm1, and the target threshold is set as the first threshold. The first threshold indicates the maximum number of frames of the image of the first frame interval that can be continuously shot. Optionally, the first threshold is twice the first number.
[0100] Step 305, FrmCnt = FrmCnt + 1, that is, add 1 to the frame count;
[0101] Step 306, FrmCnt > T? that is, judge whether the frame count is greater than the target threshold, in the case of yes, execute step 307, otherwise execute step 308;
[0102] Step 307, set FrmCnt = 1; Vts = Frm1 or Frm2; T = T1 = 2a or T = T2 = 2b, set the frame count to 1, adjust the frame interval of the target shooting device, the target threshold;
[0103] In the case of the frame count being greater than the target threshold, the shooting interval of the target shooting device needs to be adjusted, in the case of the current shooting interval being the first frame interval, adjust the shooting interval VTS of the target shooting device to the second frame interval, and the target threshold is adjusted from the first threshold to the second threshold, in the case of the current shooting interval being the second frame interval, adjust the shooting interval of the target shooting device to the first frame interval, and the target threshold T is adjusted from the second threshold to the first threshold;
[0104] That is The frame count is reset to 1.
[0105] Step 308, Expo > VTS? judge whether the exposure time is greater than the frame interval, in the case of yes, execute step 309, otherwise execute step 310;
[0106] Step 309, adjust the exposure parameter of the target shooting device;
[0107] Adjust the exposure time:
[0108] Adjust the gain:
[0109] Step 310, judge whether Gain, expo, VTS are updated, in the case of yes, execute step 311, otherwise execute step 301;
[0110] Step 311, update the driving configuration parameter of the target shooting device.
[0111] If VTS' ≠ VTS or Gain' ≠ Gain or Expo' ≠ Expo, update the corresponding VTS, Gain, Expo, that is
[0112]
[0113]
[0114]
[0115] And issue to the target shooting device drive effect shooting next frame, jump to step 301.
[0116] Figure 4 It is the schematic diagram of the image frame of shooting according to the embodiment of the present application, taking the frame rate as 15 frames, the power frequency as 50, the frame interval between the images per second as shown in Figure 4 The first frame interval Frm1 is equal to 60, the second frame interval Frm2 is equal to 70, the first number a is equal to 5, the second number b is equal to 10, the first threshold T1 = 10, and the second threshold T2 = 20.
[0117] Figure 4 The frame count corresponding to the first frame image in the 15 frame images corresponding to the Nth second in is the first number, that is, frmCnt = a = 5, and after adding 1 to the frame count, it is 6, which is less than the target threshold (at this time, the target threshold T = T1), so the shooting interval is not adjusted, the exposure parameter is adjusted, and the next frame image is shot, and the frame count corresponding to the next frame image (the second frame image in the 15 frame images corresponding to the Nth second) is 6.
[0118] The frame count corresponding to the fifth frame image in the 15 frame images corresponding to the Nth second is 9, and after adding 1 to the frame count, it is 10, which is not greater than the target threshold (at this time, the target threshold T = T1), so the shooting interval is not adjusted, the exposure parameter is adjusted, and the next frame image is shot, and the frame count corresponding to the next frame image (the sixth frame image in the 15 frame images corresponding to the Nth second) is 10.
[0119] The frame count corresponding to the sixth frame image in the 15 frame images corresponding to the Nth second is 10, and after adding 1 to the frame count, it is 11, which is greater than the target threshold (at this time, the target threshold T = T1), so the shooting interval is adjusted from the first frame interval to the second frame interval, the frame count corresponding to the sixth frame is adjusted to 1, the exposure parameter is adjusted, and the next frame image is shot, and the frame count corresponding to the next frame image (the seventh frame image in the 15 frame images corresponding to the Nth second) is 2.
[0120] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a general hardware platform as required, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.
[0121] The embodiment also provides a video shooting device, Figure 5 is a structural diagram of a video shooting device according to an embodiment of the present application, as Figure 5 shown, the device comprises:
[0122] The acquisition module 502 is configured to acquire a target frame rate N of a target shooting device and a power frequency of the target shooting device, wherein the target frame rate N is used to represent the number of frames of images shot per second by the target shooting device, and N is an integer greater than or equal to 2.
[0123] The first determination module 504 is configured to determine a power frequency half cycle according to the power frequency.
[0124] The second determination module 506 is configured to determine a first frame interval and a second frame interval according to the target frame rate and the power frequency half cycle, wherein the first frame interval and the second frame interval are both integer multiples of the power frequency half cycle.
[0125] The control module 508 is configured to control the target shooting device to shoot an ith group of images in the ith second according to the first frame interval and the second frame interval, wherein the ith group of images comprises N frames of images shot in the ith second, the frame interval between any two adjacent frames of the N frames of images is the first frame interval or the second frame interval, and i is an integer greater than or equal to 1.
[0126] In an optional embodiment, the second determination module comprises: a first determination submodule configured to, in a case where the frame rate of the target shooting device is the target frame rate, determine an average frame interval of the target shooting device as 1 / N second; a second determination submodule configured to, in a case where the power frequency half cycle is M milliseconds and the average frame interval is not an integer multiple of the power frequency half cycle, determine the first frame interval as a largest frame interval in a first frame interval set, wherein the frame intervals in the first frame interval set are less than the average frame interval and are integer multiples of the power frequency half cycle, and wherein M is equal to 1 or M is a positive integer greater than or equal to 2; and a third determination submodule configured to, in a case where the power frequency half cycle is M milliseconds and the average frame interval is not an integer multiple of the power frequency half cycle, determine the second frame interval as a smallest frame interval in a second frame interval set, wherein the frame intervals in the second frame interval set are greater than the average frame interval and are integer multiples of the power frequency half cycle.
[0127] In an optional embodiment, the control module comprises: a fourth determining submodule, configured to determine a first number and a second number according to the first frame interval and the second frame interval, wherein the first number is used to represent a frame number of images with the first frame interval per second, and the second number is used to represent a frame number of images with the second frame interval per second; and a first control submodule, configured to control the target photographing device to photograph a frame of images in the ith group of images every the first frame interval, and control the target photographing device to photograph another frame of images in the ith group of images every the second frame interval, wherein a is the first number, and b is the second number.
[0128] In an optional embodiment, the fourth determining submodule is configured to determine the first number and the second number satisfying a preset condition, wherein the preset condition comprises: a sum of the first number and the second number is equal to N; and a product of the first number and the first frame interval plus a product of the second number and the second frame interval is equal to 1s.
[0129] In an optional embodiment, the first control submodule comprises: a setting unit, configured to set a photographing interval of the target photographing device to the first frame interval, and control the target photographing device to photograph a frame of images in the ith group of images every the first frame interval; and an adjusting unit, configured to, in a case that the target photographing device photographs the frame of images, adjust the photographing interval of the target photographing device from the first frame interval to the second frame interval, and control the target photographing device to photograph another frame of images in the ith group of images every the second frame interval.
[0130] In an optional embodiment, the first control submodule is further configured to, after controlling the target photographing device to photograph the frame of images in the ith group of images every the second frame interval, control the target photographing device to photograph a frame of images in the (i+1)th group of images every the second frame interval; and in a case that the target photographing device photographs the frame of images in the (i+1)th group of images, adjust the photographing interval of the target photographing device from the second frame interval to the first frame interval, and control the target photographing device to photograph another frame of images in the (i+1)th group of images every the first frame interval.
[0131] In an optional embodiment, the apparatus is further configured to: obtain a first exposure time at which the target photographing device photographs a previous frame of a jth frame of the ith set of images before the target photographing device photographs the jth frame of the ith set of images, and a photographing interval of the target photographing device after the target photographing device photographs the previous frame; in a case where the first exposure time is greater than the photographing interval, adjust an exposure time of the target photographing device from the first exposure time to a second exposure time, where the second exposure time is equal to the photographing interval; adjust a gain of the target photographing device from a first gain corresponding to the first exposure time to a second gain corresponding to the second exposure time; and control the target photographing device to photograph the jth frame of the ith set of images in a case where photographing parameters of the target photographing device include the second exposure time and the second gain, where j is an integer greater than or equal to 1, and j and i are not simultaneously equal to 1.
[0132] In an optional embodiment, the first determining module is further configured to, in a case where the power frequency is S Hertz, determine the power frequency half cycle as
[0133] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all of the modules are located in the same processor; or each of the modules is located in a different processor in any combination.
[0134] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, where the computer program is configured to execute the steps in any of the above method embodiments when running.
[0135] In an exemplary embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0136] Embodiments of the present application also provide an electronic device, which includes a memory storing a computer program and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
[0137] In one example embodiment, the electronic device described above can further include a transmission device connected to the processor and an input / output device connected to the processor.
[0138] The specific examples in the embodiments can refer to the examples described in the above embodiments and exemplary implementation, which will not be repeated here.
[0139] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, which can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
[0140] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A video shooting method characterized by comprising: The method comprises: acquiring a target frame rate N of a target shooting device and a power frequency of the target shooting device, wherein the target frame rate N is used to represent the number of frames of images shot per second by the target shooting device, and N is an integer greater than or equal to 2; determining a power frequency half cycle according to the power frequency; determining a first frame interval and a second frame interval according to the target frame rate and the power frequency half cycle, wherein the first frame interval and the second frame interval are both integer multiples of the power frequency half cycle; determining a first number and a second number according to the first frame interval and the second frame interval, wherein the first number is used to represent the number of frames of images with the first frame interval per second, the second number is used to represent the number of frames of images with the second frame interval per second, the first number and the second number satisfy a preset condition, and the preset condition comprises: the sum of the first number and the second number is equal to N; the product of the first number and the first frame interval plus the product of the second number and the second frame interval is equal to 1s; controlling the target shooting device to shoot an i th group of images in the i th second according to the first number, the second number, the first frame interval and the second frame interval, wherein the i th group of images comprises N frames of images shot in the i th second, and the frame interval between adjacent two frames of images in the N frames of images is the first frame interval or the second frame interval, and i is an integer greater than or equal to 1.
2. The method of claim 1, wherein, The method comprises: in the case that the frame rate of the target shooting device is the target frame rate, determining an average frame interval of the target shooting device as 1 / N second; in the case that the power frequency half cycle is M milliseconds and the average frame interval is not an integer multiple of the power frequency half cycle, determining the first frame interval as the largest frame interval in a first frame interval set, wherein the frame intervals in the first frame interval set are less than the average frame interval and are integer multiples of the power frequency half cycle, wherein M is equal to 1 or M is a positive integer greater than or equal to 2; in the case that the power frequency half cycle is M milliseconds and the average frame interval is not an integer multiple of the power frequency half cycle, determining the second frame interval as the smallest frame interval in a second frame interval set, wherein the frame intervals in the second frame interval set are greater than the average frame interval and are integer multiples of the power frequency half cycle.
3. The method of claim 1, wherein, The method comprises: controlling the target shooting device to shoot a frame a of the i th group of images every the first frame interval, and controlling the target shooting device to shoot a frame b of the i th group of images every the second frame interval, wherein a is the first number and b is the second number.
4. The method of claim 3, wherein, The control of the target shooting device every other first frame interval to shoot a frame image in the i-th group of images, and the control of the target shooting device every other second frame interval to shoot a frame image in the i-th group of images, comprises: Setting the shooting interval of the target shooting device to the first frame interval, and controlling the target shooting device to shoot the first a frame images in the i-th group of images every other first frame interval; In the case that the target shooting device has finished shooting the first a frame images, adjusting the shooting interval of the target shooting device from the first frame interval to the second frame interval, and controlling the target shooting device to shoot the last b frame images in the i-th group of images every other second frame interval.
5. The method of claim 4, wherein, After the control of the target shooting device every other second frame interval to shoot the last b frame images in the i-th group of images, the method further comprises: Controlling the target shooting device to shoot the first b frame images in the i+1-th group of images every other second frame interval; In the case that the target shooting device has finished shooting the first b frame images in the i+1-th group of images, adjusting the shooting interval of the target shooting device from the second frame interval to the first frame interval, and controlling the target shooting device to shoot the last a frame images in the i+1-th group of images every other first frame interval.
6. The method of claim 3, wherein, The method further comprises: Before the target shooting device shoots the j-th frame image in the i-th group of images, acquiring a first exposure time when the target shooting device shoots a previous frame image of the j-th frame image, and a shooting interval of the target shooting device after the target shooting device shoots the previous frame image, wherein the shooting interval is the interval between the shooting of adjacent two frame images by the target shooting device; In the case that the first exposure time is greater than the shooting interval, adjusting the exposure time of the target shooting device from the first exposure time to a second exposure time, wherein the second exposure time is equal to the shooting interval; Adjusting the gain of the target shooting device from a first gain corresponding to the first exposure time to a second gain corresponding to the second exposure time; In the case that the shooting parameter of the target shooting device comprises the second exposure time and the second gain, controlling the target shooting device to shoot the j-th frame image, wherein j is an integer greater than or equal to 1, and j and i are not equal to 1 at the same time.
7. The method of claim 1, wherein, Determining a power frequency half cycle according to the power frequency, comprising: In the case that the power frequency is S Hertz, the power frequency half cycle is determined as seconds.
8. A video camera device, characterized by comprising: Comprising: An acquisition module is configured to acquire a target frame rate N of a target shooting device and a power frequency of the target shooting device, wherein the target frame rate N is used to represent the number of frames per second of the target shooting device, and N is an integer greater than or equal to 2; A first determination module is configured to determine a power frequency half cycle according to the power frequency; A second determination module is configured to determine a first frame interval and a second frame interval according to the target frame rate and the power frequency half cycle, wherein the first frame interval and the second frame interval are both integer multiples of the power frequency half cycle. A control module is configured to determine a first number and a second number according to the first frame interval and the second frame interval, wherein the first number represents a frame number of images with the first frame interval per second, the second number represents a frame number of images with the second frame interval per second, the first number and the second number satisfy a preset condition, and the preset condition includes that a sum of the first number and the second number is equal to N, and a product of the first number and the first frame interval plus a product of the second number and the second frame interval is equal to 1s; and control the target photographing device to photograph an ith set of images in an ith second according to the first number, the second number, the first frame interval and the second frame interval, wherein the ith set of images includes N frames of images photographed in the ith second, adjacent two frames of images in the N frames of images have the first frame interval or the second frame interval, and i is an integer greater than or equal to 1.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 7.
Citation Information
Patent Citations
Shooting method and device
CN115134516A
Flicker correction method and image processor
JP2012178685A