CN115103119A - Shooting method and device and electronic equipment - Google Patents

Shooting method and device and electronic equipment Download PDF

Info

Publication number
CN115103119A
CN115103119A CN202210704793.XA CN202210704793A CN115103119A CN 115103119 A CN115103119 A CN 115103119A CN 202210704793 A CN202210704793 A CN 202210704793A CN 115103119 A CN115103119 A CN 115103119A
Authority
CN
China
Prior art keywords
frame
image
detection data
shake
original image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210704793.XA
Other languages
Chinese (zh)
Inventor
陆小琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210704793.XA priority Critical patent/CN115103119A/en
Publication of CN115103119A publication Critical patent/CN115103119A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)

Abstract

The application discloses a shooting method, a shooting device and electronic equipment, and belongs to the technical field of images. Acquiring N frames of original images, and acquiring M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N; obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N; and generating a target shooting video based on the P-frame anti-shake image.

Description

Shooting method and device and electronic equipment
Technical Field
The application belongs to the technical field of images, and particularly relates to a shooting method, a shooting device and electronic equipment.
Background
With the popularization of electronic devices such as mobile phones and the advancement of shooting technologies thereof, people often use electronic devices to shoot outdoors. At present, most electronic devices are additionally provided with an anti-shake function, for example, a horizon anti-shake technology is used to improve the picture shake when a user shoots, but the frame rate adopted by the existing anti-shake technology is low, so that the shot image effect is poor.
Disclosure of Invention
The embodiment of the application aims to provide a shooting method, a shooting device and electronic equipment, and the problem that the image effect shot by the existing anti-shake technology is poor can be solved.
In a first aspect, an embodiment of the present application provides a shooting method, including:
acquiring N frames of original images, and acquiring M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N;
obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
and generating a target shooting video based on the P-frame anti-shake image. .
In a second aspect, an embodiment of the present application provides a shooting apparatus, including:
the acquisition module is used for acquiring N frames of original images, wherein N is a positive integer;
an obtaining module, configured to obtain M groups of horizon detection data corresponding to the N original images, where M is an integer greater than or equal to N;
a first processing module, configured to obtain P-frame anti-shake images based on the M groups of horizon detection data and the N frames of original images, where an image content of any of the anti-shake images includes a partial content of the original image associated therewith, and the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
and the generating module is used for generating a target shooting video based on the P frame anti-shake image. .
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, N frames of original images are collected, and M groups of horizontal line detection data corresponding to the N frames of original images are obtained, wherein N is a positive integer, and M is an integer greater than or equal to N; obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N; and generating a target shooting video based on the P frame anti-shake image. In this way, the anti-shake processing is performed on the shot original image by using the horizon detection data during shooting, so that more anti-shake images are obtained, thereby improving the shooting frame rate and reducing the dependence of data processing on hardware.
Drawings
Fig. 1 is a flowchart of a shooting method provided in an embodiment of the present application;
FIG. 2a is a schematic diagram of a 4K image captured by using horizon detection data according to an embodiment of the present application;
FIG. 2b is a schematic diagram of a 4K image captured by using horizon detection data and displacement according to an embodiment of the present application;
fig. 3 is a second flowchart of a shooting method according to an embodiment of the present application;
fig. 4 is a third flowchart of a shooting method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a shooting device provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 7 is a hardware configuration diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived from the embodiments in the present application by a person skilled in the art, are within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The horizon anti-shake technology is that the horizontal position is calculated by combining the detection data of a gravity sensor (G-sensor, GS) and a gyroscope on the basis of the image data collected by a camera, and a frame of horizontal image is intercepted from the image data collected by the camera by taking the horizontal position as a reference, so that the shooting picture is stable and does not shake by taking the horizon as the horizontal no matter how the equipment shakes during shooting. The existing horizon anti-shake technology adopts a frame rate of 30 frames per second (fps), but the hardware of electronic equipment such as a mobile phone can support the frame rate playing of 60fps, and meanwhile, the improvement of the frame rate can also improve the quality of shot video, so that better experience is brought to users, and the requirement of video playing of 60fps is met.
The existing 30fps horizon video recording technology is based on hardware and a system of electronic equipment, and obtains image frames wanted by a user after exposure, frame taking, algorithm processing and other steps. However, when the frame rate reaches 60fps, if the performance of the mobile phone hardware cannot meet the requirements (the load of a Central Processing Unit (CPU) and a Graphics Processing Unit (GPU)) is too large according to the same Processing steps, the phenomena of blocking, frame loss, jitter and the like occur, so that the real requirement of improving the video quality after improving the frame rate cannot be met.
A straightforward solution to this problem is to increase the memory and performance of the electronic device, but this solution is too costly. In order to solve the problem, the present application proposes to make up for the disadvantage that the hardware performance of the device needs to be improved by improving the frame rate through a frame compensation technique. That is, an object of the present invention is to provide a ground level anti-shake compensation frame technique for improving the frame rate of a captured video.
The shooting method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a flowchart of a shooting method according to an embodiment of the present disclosure, and as shown in fig. 1, the method includes the following steps:
step 101, acquiring N frames of original images, and acquiring M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N.
The acquiring of the N frames of original images may refer to starting a camera of the electronic device to start shooting the acquired images, so that the N frames of original images acquired by the camera can be acquired, and the acquired N frames of original images may be multi-frame images acquired during preview or images acquired after starting a shooting key to enter formal shooting.
For example, for a device with a shooting frame rate of 30 frames per second, N may be 30, that is, 30 frames of original images acquired by the camera in 1 second may be acquired, and for a device with a shooting frame rate of 60 frames per second, N may be 60, that is, 60 frames of original images acquired by the camera in 1 second may be acquired.
That is, in this step, image data generated by the camera exposure of the electronic device may be acquired and taken in units of frames. Taking a mobile phone as an example, the exposure time of a camera of the mobile phone is generally more than 1/125ms, the interval of each frame of a video of 30 frames is less than 1000/30, so the interval time of each frame of image of the video of 30 frames is 1/125ms to 1000/30 ms; similarly, the interval time of each frame of the video with 60 frames is 1/125-1000/60 ms, and the exposure times of the video with 60 frames is twice of 30 frames; the interval time of each frame of image of the 90-frame video is 1/125-1000/90 ms, and the exposure times of the 90-frame video is three times of that of 30 frames; and so on.
The above example is applicable to a shooting scene with a frame rate of 30fps, and is also applicable to a scene with a higher frame rate such as 60 fps.
In this step, M groups of horizon detection data corresponding to the N frames of original images may also be acquired, for example, the horizon detection data of the electronic device when acquiring the images may be acquired while acquiring the N frames of original images, so as to determine a deviation of the electronic device with respect to the horizon when acquiring the images. The horizon detection data may be data used for positioning the horizon detected by a gravity sensor (G-sensor, GS) and/or a gyroscope of the electronic device, and the horizon, that is, the horizontal line position, may be calculated according to the data, so that the horizon anti-shake processing may be performed on the acquired N frames of original images based on the horizon detection data, so that the acquired images are not affected by the offset of the device, and the stability of the shot image is maintained.
In the embodiment of the present application, to ensure frame compensation of the acquired image by using the horizon detection data, M groups of horizon detection data greater than or equal to N may be acquired, where the acquisition of GS and gyroscope data is not limited by exposure, and generally one group may be taken in 5ms, that is, about 200 groups of GS and gyroscope data may be acquired in 1 second, and to ensure uniformity of the acquired horizon detection data, M groups of GS and gyroscope data may be acquired at intervals from 200 groups of GS and gyroscope data, for example, when M is 60, 60 groups of GS and gyroscope data may be acquired at intervals of about 3 groups from 200 groups of GS and gyroscope data.
In one embodiment, the ground level detection data may include detection data of a gravity sensor GS of the electronic device and detection data of a gyroscope, so as to ensure that the ground level position can be accurately determined by combining the detection data of the GS and the detection data of the gyroscope, thereby ensuring accuracy of subsequent anti-shake processing on the original image.
Optionally, after acquiring the N frames of original images, the method further includes:
preprocessing the N frames of original images, wherein the preprocessing comprises at least one of anti-shake processing, sharpness processing, brightness processing and sharpness processing.
That is, to ensure the quality of the photographed image, the acquired original image of each frame may be preprocessed, that is, quality optimization processing, to improve the quality of the photographed image, which may specifically include processing such as anti-shake, sharpness, brightness, and sharpness, and the processing sequence does not affect the final output image processing result.
For 30 frames of video, 30 frames of original images can be preprocessed in one second, 60 frames of video can be preprocessed in one second, and the requirement on hardware performance is larger. Similarly, the same is true for the pre-processing of 90 frames, 120 frames of video.
Therefore, the quality of the finally output image can be ensured by preprocessing the acquired original image of each frame before the horizontal line anti-shake processing.
102, obtaining P-frame anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image includes partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N.
After obtaining M groups of horizon detection data, the M groups of horizon detection data may be used to perform anti-shake processing on the N frames of original images, and specifically, each frame of original image or a part of frames of original images in the N frames of original images may be cut out by using the M groups of horizon detection data to obtain a corresponding anti-shake image, where image content of the anti-shake image includes a part of content of the corresponding frame of original image and has an association relationship with one or more groups of horizon detection data used, the horizon detection data is used to determine a horizontal position cut out from the original image, and the anti-shake image is a horizontal image cut out from the original image according to the determined horizontal position. More specifically, at least one cut may be performed on each frame of the original image, so as to obtain an anti-shake image larger than N frames. For example, each frame of original image in the N frames of original images may be captured multiple times, or a part of the frames of original image in the N frames of original images may be captured multiple times, and another frame of original image may be captured once.
When M is equal to N, at least one frame of original image in the N frames of original images may be captured by using every two adjacent sets of horizon detection data in the M sets of horizon detection data, and when M is greater than N, a plurality of sets of horizon detection data in the M sets of horizon detection data may be used to capture one frame of original image in the N frames of original images for a plurality of times. Thus, the anti-shake image of P frame which is larger than N frame can be obtained finally.
Specifically, the original image acquired in step 101 may be high-definition image data, such as 4K image data, and the horizon anti-shake is to calculate a horizontal position based on the high-definition image data by combining GS and gyroscope data, and based on this horizontal position, a frame of high-definition horizontal image, such as a 1080P image, is captured from the high-definition image data. The horizon anti-shake video is composed of a plurality of frames of high-definition horizontal images. As shown in fig. 2a, the 4K image rotates with the lens, but the horizontal line position can always be calculated from GS and gyroscope data, and the 1080P image is truncated on the horizontal line. The GS and gyroscope data described in the present application refer to detection data of the gravity sensor GS and detection data of the gyroscope of the electronic device.
And 103, generating a target shooting video based on the P frame anti-shake image.
After the P-frame anti-shake image is obtained, the P-frame anti-shake image may be output, specifically, a target captured video may be generated based on the P-frame anti-shake image, for example, the target captured video formed by continuously playing the P-frame anti-shake image may be displayed on an electronic device, so that a user may preview an image effect of the anti-shake capture.
Optionally, M ═ lxn, L is an integer greater than 1;
the step 102 comprises:
and respectively utilizing every L groups of horizon detection data in the M groups of horizon detection data to carry out L times of interception on each frame of original image in the N frames of original images to obtain L frames of anti-shake images corresponding to each frame of original image, wherein P is equal to M.
In one embodiment, multiple sets of the horizon detection data of N may be obtained, so as to perform multiple capturing processes on each frame of original image by using the multiple sets of the horizon detection data, thereby obtaining multiple frames of anti-shake images for each frame of original image, and finally obtaining multiple frames of anti-shake images of N, thereby implementing multiple frame rate amplification.
That is, for each frame of original image, L sets of corresponding horizon detection data may be used to intercept the frame of original image L times, so that for each frame of original image, L frames of anti-shake images may be output, and for the N frames of original images, L × N frames of anti-shake images may be output.
Specifically, the obtained M groups of horizon detection data may be divided into N sets according to a set process in which each L groups of horizon detection data are set, the N sets are respectively in one-to-one correspondence with the N frames of original images, and for an ith frame of original image in the N frames of original images, the ith frame of original image may be intercepted by using the L groups of horizon detection data in the ith set, that is, the L times of interception may be performed in total, so as to obtain L frames of anti-shake images, where L may be 2, 3, or 4 equivalents.
A frame of 4K images corresponding to a set of GS and gyroscope data may output a horizon anti-shake 1080P image. In this embodiment, a frame 4K image may correspond to multiple groups of GS and gyroscope data, and multiple groups of 1080P horizon images may be acquired, thereby implementing a frame expansion technique.
For example, for a video recording of 30 frames, exposure is performed 30 times per second, and 4K image data of 30 frames can be acquired, and if 30 sets of GS and gyro data are taken to calculate the cut-out position, 1080P image data of 30 frames can be acquired.
For the video of 30 frames, if 60 groups of GS and gyroscope data are taken to calculate the clipping position, that is, 1 frame of 4K image data is clipped by two groups of GS and gyroscope data, so that 2 frames of 1080P image data can be obtained. Thus, a 60-frame 1080P picture recording was obtained by 4K recording of 30 frames.
Similarly, this embodiment can be applied to input image data of 30 frames or 60 frames from the source and output anti-shake images of 60 frames, 90 frames or 120 frames from the source.
Through the technology, the final 30 frames of horizon anti-shake video can be made into 60 frames or 120 frames or even higher frames of video, so that the purpose of improving the video quality is achieved.
The implementation flow in this embodiment may be as shown in fig. 3.
Alternatively, M is equal to N;
the step 102 comprises:
determining the displacement between the pixel of the j frame original image and the pixel of the j +1 frame original image according to a group of horizon detection data corresponding to the j frame original image in the N frame original images and a group of horizon detection data corresponding to the j +1 frame original image in the N frame original images, wherein j is any integer from 1 to N;
and performing L times of interception on the j-th frame original image by using a group of horizon detection data and the displacement corresponding to the j-th frame original image to obtain an L-frame anti-shake image corresponding to the j-th frame original image, wherein P is L multiplied by N.
In another embodiment, N sets of horizontal line detection data having the same number as that of the N frames of original images may be obtained, so as to calculate the displacement between pixels of two adjacent frames of original images by using the adjacent sets of horizontal line detection data, and then perform multiple capturing processes on each frame of original image by using the corresponding sets of horizontal line detection data and displacement, so as to obtain multiple frames of anti-shake images for each frame of original image, and finally obtain multiple frames of anti-shake images of N, thereby achieving multiple frame rate amplification.
For each frame of original image, the corresponding adjacent groups of horizon detection data can be used to calculate the displacement, and then the corresponding groups of horizon detection data and the displacement are combined to intercept the frame of original image for L times, so that for each frame of original image, L frames of anti-shake images can be output, and for the N frames of original images, L multiplied by N frames of anti-shake images can be output.
Specifically, the displacement between the pixels of the two adjacent frames of original images may be calculated according to every two adjacent sets of the horizon detection data in the M sets of the horizon detection data, for example, for an ith frame of original image in the N frames of original images, the displacement between the pixel of the jth frame of original image and the pixel of the jth +1 frame of original image may be calculated according to the corresponding jth set of the horizon detection data and the jth +1 set of the horizon detection data, and then the jth set of the horizon detection data and the displacement are used to perform multiple times of clipping on the jth frame of original image, wherein L may be 2, 3, 4, and so on, to obtain an L frame of anti-shake image.
Therefore, through the embodiment, the N frames of original images can be subjected to anti-shake processing, and multiple frames of anti-shake images of N are output, so that the aim of improving the video quality is fulfilled.
Further, the performing, by using a set of horizon detection data and the displacement corresponding to the jth frame of original image, L times of truncations on the jth frame of original image includes:
intercepting the jth frame original image by using a group of horizon detection data corresponding to the jth frame original image to obtain a frame of anti-shake image corresponding to the jth frame original image;
and performing L-1 times of interception on the jth frame of original image by using a group of horizontal line detection data corresponding to the jth frame of original image and the 1/L of the displacement to obtain an L-1 frame of anti-shake image corresponding to the jth frame of original image.
That is, more specifically, for the jth original image, the jth original image may be subjected to primary clipping by using the jth group of horizontal line detection data to output a corresponding anti-shake image, and then, the jth original image may be subjected to one or more secondary clipping by using the jth group of horizontal line detection data in combination with the displacement between the jth original image pixel and the jth +1 th original image pixel to output a corresponding anti-shake image of one or more frames, so that for the jth original image, a corresponding anti-shake image of multiple frames may be output.
When the jth frame original image is intercepted by using the jth group of horizon detection data and combining the displacement between the jth frame original image pixel and the jth +1 frame original image pixel, the specific interception times can be determined according to the frame rate required to be amplified, the displacement is divided according to the interception times, and then the jth frame original image is intercepted for multiple times according to the divided displacement. For example, the jth frame of original image may be intercepted again by using the jth group of horizon detection data in combination with the 1/2 of the displacement, that is, a frame of image is inserted between the jth frame of original image and the jth +1 frame of original image; and the jth group of horizon detection data can also be utilized to combine with the 1/3 of the displacement to perform two times of interception on the jth frame original image, namely to insert two frames of images between the jth frame original image and the (j + 1) th frame original image.
A frame of 4K images corresponding to a set of GS and gyroscope data may output a horizon anti-shake 1080P image. In this embodiment, two adjacent sets of GS and gyroscope data may be taken to calculate the displacement X between the pixels of the two frames of original images.
Then, intercepting 1080P image data of a frame of 4K image data through a group of GS and gyroscope data; and then GS and gyroscope data are combined with displacement X/2, and 1080P image data of one frame is obtained, so that 2 frames of 1080P image data are obtained from 4K image data of one frame. As shown in fig. 2b, a set of GS and gyroscope data, and a set of GS and gyroscope data combined with displacement are used to intercept one frame of 4K image data, so as to obtain two frames of 1080P image data.
For example, for a video recording of 30 frames, exposure is performed 30 times per second, and 4K image data of 30 frames can be acquired, and if 30 sets of GS and gyro data are taken to calculate the cut-out position, 1080P image data of 30 frames can be acquired.
For the video of 30 frames, if 30 groups of GS and gyroscope data are taken to calculate the displacement between the intercepting position and the pixels of the two adjacent frames of images, namely 1 frame of 4K image data is intercepted by one group of GS and gyroscope data and one group of displacement data, and 2 frames of 1080P image data are obtained. Thus, a 4K video of 30 frames obtains 60 frames of 1080P image data.
Similarly, this embodiment can be applied to image data of input source 30 frames and 60 frames, and anti-shake image of output source 60 frames, 90 frames, and 120 frames.
Through the technology, the final 30 frames of horizon anti-shake video can be made into 60 frames or 120 frames or even higher, so that the purpose of improving the video quality is achieved.
The implementation flow in this embodiment may be as shown in fig. 4.
According to the embodiment of the application, the functions of preventing the horizontal line from shaking and improving the shooting frame rate can be realized, and meanwhile, the dependence of data processing on hardware is reduced.
The shooting method in the embodiment of the application acquires N frames of original images and acquires M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N; obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N; and generating a target shooting video based on the P frame anti-shake image. In this way, each frame of original image is subjected to anti-shake processing by using the horizon detection data during shooting, so that more frames of anti-shake images are obtained, the shooting frame rate is improved, and the dependence of data processing on hardware can be reduced.
According to the shooting method provided by the embodiment of the application, the execution main body can be a shooting device. The embodiment of the present application takes an example in which a shooting device executes a shooting method, and the shooting device provided in the embodiment of the present application is described.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a camera according to an embodiment of the present disclosure, and as shown in fig. 5, a camera 500 includes:
an acquisition module 501, configured to acquire N frames of original images, where N is a positive integer;
an obtaining module 502, configured to obtain M groups of horizon detection data corresponding to the N original images, where M is an integer greater than or equal to N;
a first processing module 503, configured to obtain P-frame anti-shake images based on the M groups of horizon detection data and the N frames of original images, where an image content of any of the anti-shake images includes a partial content of the original image associated therewith, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
a generating module 504, configured to generate a target captured video based on the P-frame anti-shake image.
Optionally, the horizon detection data includes detection data of a gravity sensor and detection data of a gyroscope of the electronic device.
Optionally, M ═ L × N, L is an integer greater than 1;
the first processing module 503 is configured to perform L times of clipping on each frame of original image in the N frames of original images by using each L groups of horizon detection data in the M groups of horizon detection data, respectively, to obtain L frames of anti-shake images corresponding to each frame of original image, where P is equal to M.
Alternatively, M is equal to N;
the first processing module 503 includes:
a determining unit, configured to determine, according to a set of horizon line detection data corresponding to a jth original image in the N original images and a set of horizon line detection data corresponding to a j +1 th original image in the N original images, a displacement between a pixel of the jth original image and a pixel of the j +1 th original image, where j is any integer between 1 and N;
and the processing unit is used for performing L times of interception on the j-th frame original image by using a group of horizontal line detection data and the displacement corresponding to the j-th frame original image to obtain an L-frame anti-shake image corresponding to the j-th frame original image, wherein P is L multiplied by N.
Optionally, the processing unit comprises:
the first processing subunit is configured to intercept the jth frame original image by using a group of horizon detection data corresponding to the jth frame original image, so as to obtain a frame of anti-shake image corresponding to the jth frame original image;
and the second processing subunit is configured to perform L-1 times of interception on the jth frame of original image by using a group of horizon detection data corresponding to the jth frame of original image and 1/L of the displacement, so as to obtain an L-1 frame of anti-shake image corresponding to the jth frame of original image.
Optionally, the photographing apparatus 500 further includes:
and the second processing module is used for preprocessing the N frames of original images, wherein the preprocessing comprises at least one of anti-shake processing, definition processing, brightness processing and sharpness processing.
The shooting device in the embodiment of the application collects N frames of original images and acquires M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N; obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N; and generating a target shooting video based on the P frame anti-shake image. In this way, each frame of original image is subjected to anti-shake processing by using the horizon detection data during shooting, so that more frames of anti-shake images are obtained, the shooting frame rate is improved, and the dependence of data processing on hardware can be reduced.
The shooting device in the embodiment of the present application may be an electronic device, and may also be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet Computer, a notebook Computer, a palm top Computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an Ultra-Mobile Personal Computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (Television, TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The photographing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The shooting device provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 to 4, and is not described here again to avoid repetition.
Optionally, as shown in fig. 6, an electronic device 600 is further provided in an embodiment of the present application, and includes a processor 601 and a memory 602, where a program or an instruction that can be executed on the processor 601 is stored in the memory 602, and when the program or the instruction is executed by the processor 601, the steps of the foregoing shooting method embodiment are implemented, and the same technical effects can be achieved, and are not described again here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 710 is configured to acquire N frames of original images and acquire M groups of horizon detection data corresponding to the N frames of original images, where N is a positive integer and M is an integer greater than or equal to N;
obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
and generating a target shooting video based on the P frame anti-shake image.
Optionally, the horizon detection data includes detection data of a gravity sensor and detection data of a gyroscope of the electronic device.
Optionally, M ═ lxn, L is an integer greater than 1;
the processor 710 is further configured to perform L times of clipping on each frame of the N frames of original images by using each L groups of horizon detection data in the M groups of horizon detection data, respectively, to obtain L frames of anti-shake images corresponding to each frame of original images, where P is equal to M.
Alternatively, M is equal to N;
the processor 710 is further configured to determine a displacement between a pixel of the j-th frame original image and a pixel of the j + 1-th frame original image according to a set of horizontal line detection data corresponding to a j-th frame original image in the N-frame original images and a set of horizontal line detection data corresponding to a j + 1-th frame original image in the N-frame original images, where j is any integer from 1 to N;
and performing L times of interception on the j-th frame original image by using a group of horizon detection data and the displacement corresponding to the j-th frame original image to obtain an L-frame anti-shake image corresponding to the j-th frame original image, wherein P is L multiplied by N.
Optionally, the processor 710 is further configured to intercept the jth frame of original image by using a group of horizon detection data corresponding to the jth frame of original image, so as to obtain a frame of anti-shake image corresponding to the jth frame of original image;
and performing L-1 times of interception on the j frame original image by using a group of horizontal line detection data corresponding to the j frame original image and the 1/L of the displacement to obtain an L-1 frame anti-shake image corresponding to the j frame original image.
Optionally, the processor 710 is further configured to pre-process the N frames of original images, wherein the pre-process includes at least one of an anti-shake process, a sharpness process, a brightness process and a sharpness process.
The electronic equipment in the embodiment of the application acquires N frames of original images and acquires M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N; and obtaining P-frame anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the image content, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer larger than N. In this way, each frame of original image is subjected to anti-shake processing by using the horizon detection data during shooting, so that more frames of anti-shake images are obtained, the shooting frame rate is improved, and the dependence of data processing on hardware can be reduced.
It should be understood that, in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics processor 7041 processes image data of a still picture or a video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a first storage area for storing a program or an instruction and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. Further, the memory 709 can include volatile memory or nonvolatile memory, or the memory 709 can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 709 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor, which primarily handles operations related to the operating system, user interface, and applications, and a modem processor, which primarily handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above shooting method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the foregoing shooting method embodiment, and can achieve the same technical effect, and for avoiding repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing shooting method embodiments, and achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatuses in the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions recited, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. A shooting method, characterized by comprising:
acquiring N frames of original images, and acquiring M groups of horizon detection data corresponding to the N frames of original images, wherein N is a positive integer, and M is an integer greater than or equal to N;
obtaining P frames of anti-shake images based on the M groups of horizon detection data and the N frames of original images, wherein the image content of any anti-shake image comprises partial content of the original image associated with the anti-shake image, the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
and generating a target shooting video based on the P frame anti-shake image.
2. The method of claim 1, wherein the horizon detection data comprises detection data of a gravity sensor and detection data of a gyroscope of the electronic device.
3. The method of claim 1, wherein M x N, L being an integer greater than 1;
the obtaining of the P-frame anti-shake image based on the M groups of horizon detection data and the N frames of original images includes:
and respectively utilizing every L groups of horizon detection data in the M groups of horizon detection data to carry out L times of interception on each frame of original image in the N frames of original images to obtain L frames of anti-shake images corresponding to each frame of original image, wherein P is equal to M.
4. The method of claim 1, wherein M is equal to N;
the obtaining of the P-frame anti-shake image based on the M groups of horizon detection data and the N-frame original images includes:
determining the displacement between the pixel of the j frame original image and the pixel of the j +1 frame original image according to a group of horizontal line detection data corresponding to the j frame original image in the N frame original images and a group of horizontal line detection data corresponding to the j +1 frame original image in the N frame original images, wherein j is any integer from 1 to N;
and performing L times of interception on the j-th frame original image by using a group of horizon detection data and the displacement corresponding to the j-th frame original image to obtain an L-frame anti-shake image corresponding to the j-th frame original image, wherein P is L multiplied by N.
5. The method according to claim 4, wherein the truncating the j frame original image for L times by using a set of horizon detection data and the displacement corresponding to the j frame original image comprises:
intercepting the jth frame original image by using a group of horizon detection data corresponding to the jth frame original image to obtain a frame of anti-shake image corresponding to the jth frame original image;
and performing L-1 times of interception on the j frame original image by using a group of horizontal line detection data corresponding to the j frame original image and the 1/L of the displacement to obtain an L-1 frame anti-shake image corresponding to the j frame original image.
6. The method according to any one of claims 1 to 5, wherein after the acquiring N original images, before the obtaining P anti-shake images based on the M sets of horizon detection data and the N original images, the method further comprises:
preprocessing the N frames of original images, wherein the preprocessing comprises at least one of anti-shake processing, sharpness processing, brightness processing and sharpness processing.
7. A camera, comprising:
the acquisition module is used for acquiring N frames of original images, wherein N is a positive integer;
an obtaining module, configured to obtain M groups of horizon detection data corresponding to the N original images, where M is an integer greater than or equal to N;
a first processing module, configured to obtain P-frame anti-shake images based on the M groups of horizon detection data and the N frames of original images, where an image content of any of the anti-shake images includes a partial content of the original image associated therewith, and the image content of the anti-shake image has an association relationship with the horizon detection data, and P is an integer greater than N;
and the generating module is used for generating a target shooting video based on the P frame anti-shake image.
8. The camera according to claim 7, wherein the horizon detection data includes detection data of a gravity sensor of the electronic device and detection data of a gyroscope.
9. The imaging apparatus according to claim 7, wherein M is lxn, and L is an integer greater than 1;
the first processing module is configured to perform L times of capturing on each frame of original image in the N frames of original images by using each L groups of horizon detection data in the M groups of horizon detection data, respectively, to obtain L frames of anti-shake images corresponding to each frame of original image, where P is equal to M.
10. The camera of claim 7, wherein M is equal to N;
the first processing module comprises:
a determining unit, configured to determine, according to a set of horizon line detection data corresponding to a jth original image in the N original images and a set of horizon line detection data corresponding to a j +1 th original image in the N original images, a displacement between a pixel of the jth original image and a pixel of the j +1 th original image, where j is any integer between 1 and N;
and the processing unit is used for performing L times of interception on the jth frame of original image by using a group of horizontal line detection data and the displacement corresponding to the jth frame of original image to obtain an L frame of anti-shake image corresponding to the jth frame of original image, wherein P is L multiplied by N.
11. The camera of claim 10, wherein the processing unit comprises:
the first processing subunit is configured to intercept the jth frame original image by using a group of horizon detection data corresponding to the jth frame original image, so as to obtain a frame of anti-shake image corresponding to the jth frame original image;
and the second processing subunit is used for performing L-1 times of interception on the j-th frame original image by using a group of horizontal line detection data corresponding to the j-th frame original image and the 1/L of the displacement to obtain an L-1 frame anti-shake image corresponding to the j-th frame original image.
12. The photographing apparatus according to any one of claims 7 to 11, further comprising:
and the second processing module is used for preprocessing the N frames of original images, wherein the preprocessing comprises at least one of anti-shake processing, definition processing, brightness processing and sharpness processing.
CN202210704793.XA 2022-06-21 2022-06-21 Shooting method and device and electronic equipment Pending CN115103119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210704793.XA CN115103119A (en) 2022-06-21 2022-06-21 Shooting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210704793.XA CN115103119A (en) 2022-06-21 2022-06-21 Shooting method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115103119A true CN115103119A (en) 2022-09-23

Family

ID=83293046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210704793.XA Pending CN115103119A (en) 2022-06-21 2022-06-21 Shooting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115103119A (en)

Similar Documents

Publication Publication Date Title
CN112637500B (en) Image processing method and device
US20230086416A1 (en) Anti-shake method, anti-shake apparatus, and electronic device
CN114390197A (en) Shooting method and device, electronic equipment and readable storage medium
CN113891005B (en) Shooting method and device and electronic equipment
CN112738398B (en) Image anti-shake method and device and electronic equipment
CN114785957A (en) Shooting method and device thereof
CN112672058B (en) Shooting method and device
CN115499589A (en) Shooting method, shooting device, electronic equipment and medium
CN112738399B (en) Image processing method and device and electronic equipment
CN112261262B (en) Image calibration method and device, electronic equipment and readable storage medium
CN114390206A (en) Shooting method and device and electronic equipment
CN115103119A (en) Shooting method and device and electronic equipment
CN111654623B (en) Photographing method and device and electronic equipment
CN112399092A (en) Shooting method and device and electronic equipment
CN113037996A (en) Image processing method and device and electronic equipment
CN112291474A (en) Image acquisition method and device and electronic equipment
CN112367464A (en) Image output method and device and electronic equipment
CN112367470B (en) Image processing method and device and electronic equipment
CN117097982B (en) Target detection method and system
CN114157810B (en) Shooting method, shooting device, electronic equipment and medium
CN115278053A (en) Image shooting method and electronic equipment
CN116916147A (en) Image processing method, image sending device and electronic equipment
CN115103112A (en) Lens control method and electronic equipment
CN117745528A (en) Image processing method and device
CN116320729A (en) Image processing method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination