CN116095484B - Video anti-shake method and device and electronic equipment - Google Patents
Video anti-shake method and device and electronic equipment Download PDFInfo
- Publication number
- CN116095484B CN116095484B CN202111285418.8A CN202111285418A CN116095484B CN 116095484 B CN116095484 B CN 116095484B CN 202111285418 A CN202111285418 A CN 202111285418A CN 116095484 B CN116095484 B CN 116095484B
- Authority
- CN
- China
- Prior art keywords
- frame image
- path
- frame
- image
- optimal path
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/68—Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
本申请提供了一种视频防抖方法、装置及电子设备,涉及人工智能技术领域。该视频防抖方法可以在使用EIS进行防抖时自适应对第一次路径优化得到的结果进行矫正,从而缓解了第一次路径优化产生的误差累积,进而可以保证能够输出稳定的图像,提升了防抖效果。此外,该方法中在进行第一次路径优化前也可以使用OIS的偏移量和预设数量的帧图像的位置预测下一帧图像的位置,从而提升了预测的准确性。
The present application provides a video stabilization method, device and electronic device, which relate to the field of artificial intelligence technology. The video stabilization method can adaptively correct the result obtained by the first path optimization when using EIS for stabilization, thereby alleviating the error accumulation caused by the first path optimization, and then can ensure that a stable image can be output, thereby improving the stabilization effect. In addition, in this method, before performing the first path optimization, the offset of OIS and the position of a preset number of frame images can also be used to predict the position of the next frame image, thereby improving the accuracy of the prediction.
Description
技术领域Technical Field
本申请涉及人工智能技术领域,尤其涉及一种视频防抖方法、装置及电子设备。The present application relates to the field of artificial intelligence technology, and in particular to a video stabilization method, device and electronic device.
背景技术Background technique
视频拍摄是带摄像头的电子设备(比如:手机、平板、运动相机等)的基础功能。拍摄高清晰度和强画面稳定性的视频是产品核心竞争力之一。目前,在拍摄视频时主要采用电子防抖技术(electric image stabilization,EIS),但在某些场景下,比如:长曝光下手抖模糊带来的画面颤动场景,单一的EIS技术的防抖效果较差。Video shooting is a basic function of electronic devices with cameras (such as mobile phones, tablets, sports cameras, etc.). Shooting videos with high definition and strong image stability is one of the core competitiveness of products. At present, the electronic image stabilization (EIS) technology is mainly used when shooting videos, but in some scenes, such as the scene of image trembling caused by hand shaking and blur under long exposure, the single EIS technology has poor anti-shake effect.
发明内容Summary of the invention
本申请提供了一种视频防抖方法、装置及电子设备,能够保证输出稳定的图像,提升了防抖效果。The present application provides a video stabilization method, device and electronic device, which can ensure the output of stable images and improve the stabilization effect.
第一方面,本申请提供了一种视频防抖方法,该方法包括:获取第t帧图像和第t帧图像对应的第一位置,第一位置由拍摄第t帧图像的设备在拍摄第t帧图像时的运动数据所表示,t为大于或等于1的正整数;将第一位置和在第t帧图像之前的n帧图像的位置均输入至未来路径预测模型,得到第(t+1)帧图像对应的第一预测位置;根据第一位置、在第t帧图像之前的(n-1)帧图像的位置和第一预测位置,进行第一次路径优化,得到第一最优路径,第一最优路径中包括第t帧图像之前的(n-1)帧图像、第t帧图像和第(t+1)帧图像均为稳定的图像时各帧图像的理想位置,n为大于或等于1的正整数;确定目标帧图像的位置与目标帧图像对应的预测位置之间的目标偏差值大于预设偏差阈值,利用目标误差矫正量,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正,目标帧图像包括第t帧图像和在第t帧图像之前的n帧图像;根据第一位置和在第t帧图像之前的n帧图像的位置,进行第二次路径优化,得到第二最优路径,第二最优路径中包括第t帧图像之前的(n-1)帧图像和第t帧图像均为稳定的图像时各帧图像的理想位置;根据第一位置和第二最优路径中第t帧图像对应的第二理想位置,对第t帧图像进行处理,得到稳定的图像。这样,在使用EIS进行防抖时可以自适应对第一次路径优化得到的结果进行矫正,从而缓解了第一次路径优化产生的误差累积,并降低了第一次路径优化的结果在对下一帧图像处理时进行第二次路径优化的影响,进而保证能够输出稳定的图像,提升了防抖效果。其中,第一次路径优化的结果可以用于确定在对下一帧图像处理且进行第二次路径优化时对下一帧图像进行裁剪的边界。In a first aspect, the present application provides a video stabilization method, the method comprising: obtaining a t-th frame image and a first position corresponding to the t-th frame image, the first position being represented by motion data of a device shooting the t-th frame image when shooting the t-th frame image, and t being a positive integer greater than or equal to 1; inputting the first position and the positions of n frames of images before the t-th frame image into a future path prediction model to obtain a first predicted position corresponding to the (t+1)-th frame image; performing a first path optimization based on the first position, the position of the (n-1) frame image before the t-th frame image, and the first predicted position to obtain a first optimal path, the first optimal path including the ideal positions of each frame image when the (n-1) frame image before the t-th frame image, the t-th frame image, and the (t+1)-th frame image are all stable images. , n is a positive integer greater than or equal to 1; determine that the target deviation value between the position of the target frame image and the predicted position corresponding to the target frame image is greater than the preset deviation threshold, and use the target error correction amount to correct the first ideal position corresponding to the (t+1)th frame image in the first optimal path, the target frame image includes the tth frame image and the n frames before the tth frame image; perform a second path optimization according to the first position and the positions of the n frames before the tth frame image to obtain the second optimal path, the second optimal path includes the ideal positions of each frame image when the (n-1) frames before the tth frame image and the tth frame image are both stable images; process the tth frame image according to the first position and the second ideal position corresponding to the tth frame image in the second optimal path to obtain a stable image. In this way, when using EIS for anti-shake, the result obtained by the first path optimization can be adaptively corrected, thereby alleviating the error accumulation generated by the first path optimization, and reducing the influence of the result of the first path optimization on the second path optimization when processing the next frame image, thereby ensuring that a stable image can be output and improving the anti-shake effect. The result of the first path optimization may be used to determine the boundary for cropping the next frame of image when processing the next frame of image and performing the second path optimization.
在一种可能的实现方式中,利用目标误差矫正量,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正,具体包括:利用目标误差矫正量和预先设定的矫正量缩放比例,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正。In one possible implementation, the target error correction amount is used to correct the first ideal position corresponding to the (t+1)th frame image in the first optimal path, specifically including: using the target error correction amount and a pre-set correction amount scaling ratio to correct the first ideal position corresponding to the (t+1)th frame image in the first optimal path.
在一种可能的实现方式中,目标误差矫正量为预先设定的矫正量;或者,目标误差矫正量为对第(t-1)帧图像进行第二次路径优化得到的最优路径中第(t-1)帧图像的理想位置和对第(t-1)帧图像进行第一次路径优化得到的最优路径中第(t-1)帧图像的理想位置之间的差。In one possible implementation, the target error correction amount is a preset correction amount; or, the target error correction amount is the difference between an ideal position of the (t-1)th frame image in an optimal path obtained by performing a second path optimization on the (t-1)th frame image and an ideal position of the (t-1)th frame image in an optimal path obtained by performing a first path optimization on the (t-1)th frame image.
在一种可能的实现方式中,将第一位置和在第t帧图像之前的n帧图像的位置均输入至未来路径预测模型,得到第(t+1)帧图像对应的第一预测位置,具体包括:获取拍摄第t帧图像的设备上的光学防抖模块的偏移量;将第一位置、在第t帧图像之前的n帧图像的位置和偏移量均输入至未来路径预测模型,得到第(t+1)帧图像对应的第一预测位置。这样,在两级EIS防抖时使用“光学防抖模块(即OIS)的偏移量”和“各帧图像的历史真实位置”做为输入,并在第一次路径优化前,对未来1帧的运动状态做预测,提升了预测准确性。In a possible implementation, the first position and the positions of the n frames before the t-th frame are input into the future path prediction model to obtain the first predicted position corresponding to the (t+1)-th frame, specifically including: obtaining the offset of the optical image stabilization module on the device that shoots the t-th frame; the first position, the positions and offsets of the n frames before the t-th frame are input into the future path prediction model to obtain the first predicted position corresponding to the (t+1)-th frame. In this way, the "offset of the optical image stabilization module (i.e., OIS)" and the "historical real position of each frame" are used as inputs in the two-level EIS anti-shake, and the motion state of the next frame is predicted before the first path optimization, thereby improving the prediction accuracy.
第二方面,本申请提供了一种视频防抖装置,装置包括:获取模块,用于获取第t帧图像和第t帧图像对应的第一位置,第一位置由拍摄第t帧图像的设备在拍摄第t帧图像时的运动数据所表示,t为大于或等于1的正整数;处理模块,将第一位置和在第t帧图像之前的n帧图像的位置均输入至未来路径预测模型,得到第(t+1)帧图像对应的第一预测位置;处理模块,还用于根据第一位置、在第t帧图像之前的(n-1)帧图像的位置和第一预测位置,进行第一次路径优化,得到第一最优路径,第一最优路径中包括第t帧图像之前的(n-1)帧图像、第t帧图像和第(t+1)帧图像均为稳定的图像时各帧图像的理想位置,n为大于或等于1的正整数;处理模块,还用于确定目标帧图像的位置与目标帧图像对应的预测位置之间的目标偏差值大于预设偏差阈值,利用目标误差矫正量,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正,目标帧图像包括第t帧图像和在第t帧图像之前的n帧图像;处理模块,还用于根据第一位置和在第t帧图像之前的n帧图像的位置,进行第二次路径优化,得到第二最优路径,第二最优路径中包括第t帧图像之前的(n-1)帧图像和第t帧图像均为稳定的图像时各帧图像的理想位置;处理模块,还用于根据第一位置和第二最优路径中第t帧图像对应的第二理想位置,对第t帧图像进行处理,得到稳定的图像。In a second aspect, the present application provides a video stabilization device, the device comprising: an acquisition module, used to acquire the t-th frame image and a first position corresponding to the t-th frame image, the first position being represented by motion data of a device shooting the t-th frame image when shooting the t-th frame image, and t being a positive integer greater than or equal to 1; a processing module, inputting the first position and the positions of n frames of images before the t-th frame image into a future path prediction model to obtain a first predicted position corresponding to the (t+1)-th frame image; the processing module is also used to perform a first path optimization based on the first position, the position of the (n-1)-th frame image before the t-th frame image, and the first predicted position to obtain a first optimal path, the first optimal path including the ideal positions of each frame image when the (n-1)-th frame image before the t-th frame image, the t-th frame image, and the (t+1)-th frame image are all stable images, and n is A positive integer greater than or equal to 1; a processing module, further used to determine that a target deviation value between the position of a target frame image and a predicted position corresponding to the target frame image is greater than a preset deviation threshold, and using a target error correction amount, correcting a first ideal position corresponding to the (t+1)th frame image in the first optimal path, wherein the target frame image includes the tth frame image and n frames of images before the tth frame image; the processing module is further used to perform a second path optimization according to the first position and the positions of n frames of images before the tth frame image to obtain a second optimal path, wherein the second optimal path includes the (n-1) frames of images before the tth frame image and the ideal positions of each frame image when the tth frame image is a stable image; the processing module is further used to process the tth frame image according to the first position and the second ideal position corresponding to the tth frame image in the second optimal path to obtain a stable image.
在一种可能的实现方式中,处理模块,还用于:利用目标误差矫正量和预先设定的矫正量缩放比例,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正。In a possible implementation, the processing module is further used to correct the first ideal position corresponding to the (t+1)th frame image in the first optimal path by using the target error correction amount and a preset correction amount scaling ratio.
在一种可能的实现方式中,目标误差矫正量为预先设定的矫正量;或者,目标误差矫正量为对第(t-1)帧图像进行第二次路径优化得到的最优路径中第(t-1)帧图像的理想位置和对第(t-1)帧图像进行第一次路径优化得到的最优路径中第(t-1)帧图像的理想位置之间的差。In one possible implementation, the target error correction amount is a preset correction amount; or, the target error correction amount is the difference between an ideal position of the (t-1)th frame image in an optimal path obtained by performing a second path optimization on the (t-1)th frame image and an ideal position of the (t-1)th frame image in an optimal path obtained by performing a first path optimization on the (t-1)th frame image.
在一种可能的实现方式中,获取模块,还用于:获取拍摄第t帧图像的设备上的光学防抖模块的偏移量;处理模块,还用于:将第一位置、在第t帧图像之前的n帧图像的位置和偏移量均输入至未来路径预测模型,得到第(t+1)帧图像对应的第一预测位置。In a possible implementation, the acquisition module is further used to: obtain the offset of the optical image stabilization module on the device that captures the t-th frame image; the processing module is further used to: input the first position, the position and the offset of the n-frame images before the t-th frame image into the future path prediction model to obtain the first predicted position corresponding to the (t+1)-th frame image.
第三方面,本申请提供了一种电子设备,包括:In a third aspect, the present application provides an electronic device, including:
至少一个存储器,用于存储程序;at least one memory for storing a program;
至少一个处理器,用于执行存储器存储的程序,当存储器存储的程序被执行时,处理器用于执行如第一方面中提供的方法。At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method provided in the first aspect.
第四方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第一方面中提供的方法。In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed on an electronic device, the electronic device executes the method provided in the first aspect.
第五方面,本申请提供了一种计算机程序产品,其特征在于,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面中提供的方法。In a fifth aspect, the present application provides a computer program product, characterized in that when the computer program product is run on an electronic device, the electronic device executes the method provided in the first aspect.
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请实施例提供的一种电子设备的硬件结构示意图;FIG1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
图2是本申请实施例提供的一种视频防抖方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a video anti-shake method provided in an embodiment of the present application;
图3是本申请实施例提供的一种视频防抖方法的步骤示意图;FIG3 is a schematic diagram of the steps of a video anti-shake method provided by an embodiment of the present application;
图4是本申请实施例提供的又一种视频防抖方法的步骤示意图;FIG4 is a schematic diagram of the steps of another video anti-shake method provided by an embodiment of the present application;
图5是本申请实施例提供的一种视频防抖装置的结构示意图。FIG. 5 is a schematic structural diagram of a video stabilization device provided in an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
本文中术语“和/或”,是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本文中符号“/”表示关联对象是或者的关系,例如A/B表示A或者B。The term "and/or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol "/" in this article indicates that the associated objects are in an or relationship, for example, A/B means A or B.
本文中的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一响应消息和第二响应消息等是用于区别不同的响应消息,而不是用于描述响应消息的特定顺序。The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或者两个以上,例如,多个处理单元是指两个或者两个以上的处理单元等;多个元件是指两个或者两个以上的元件等。In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
示例性的,电子防抖技术(electric image stabilization,EIS)主要是通过程序对图像传感器上的图像进行分析和采集,当单帧图像画面内容出现扭曲拉伸,或者连续多帧图像画面之间存在较大跳跃,即视频的抖动现象时,可以利用图像变换、移动像素位置等,消除抖动现象,从而实现“防抖”,其实现原理更像是对图像进行“后期处理”。For example, the electronic image stabilization (EIS) technology mainly analyzes and collects images on the image sensor through a program. When the content of a single-frame image is distorted and stretched, or there are large jumps between consecutive frames of images, that is, the video shakes, the image transformation, moving pixel positions, etc. can be used to eliminate the shake phenomenon, thereby achieving "anti-shake". Its implementation principle is more like "post-processing" of the image.
一般的,电子防抖技术采用的是两级电子防抖技术(two-stage electric imagestabilization,Two-Stage EIS)。该两级电子防抖技术可以在保证防抖效果前提下,分两步进行图像裁剪,从而降低通路上在EIS模块之前的图像处理模块的计算量和存储量。该两级电子防抖技术主要是通过两次路径优化,得到视频画面稳定的最优路径,然后再将输出的视频画面轨迹调整到该最优路径上,从而得到画面稳定性最佳的视频。可以理解的是,电子设备在移动过程中,其上的惯性度量单元(inertial measurement unit,IMU)可记录电子设备在某时刻的运动状态(比如:轴角速度、加速度等),IMU记录的是电子设备的机身真实运动的过程,即为电子设备的机身的真实路径。在拍摄视频时,每帧画面对应时刻的电子设备的机身运动状态可表示为一个向量,即为路径上的一个点。多个连续画面帧对应的多个连续向量,即组成电子设备的机身运动的路径。其中,最优路径是指通过使用滤波或优化等算法对电子设备的机身的真实路径进行处理,得到的连续且平滑的、虚拟的、理想的路径。此外,计算最优路径的过程即为路径优化。Generally, the electronic image stabilization technology adopts two-stage electronic image stabilization (Two-Stage EIS). The two-stage electronic image stabilization technology can perform image cropping in two steps while ensuring the anti-shake effect, thereby reducing the amount of calculation and storage of the image processing module before the EIS module in the path. The two-stage electronic image stabilization technology mainly obtains the optimal path for video image stability through two path optimizations, and then adjusts the output video image trajectory to the optimal path, thereby obtaining a video with the best image stability. It can be understood that when the electronic device is moving, the inertial measurement unit (IMU) on it can record the motion state of the electronic device at a certain moment (such as: axis angular velocity, acceleration, etc.). The IMU records the real motion process of the electronic device, that is, the real path of the electronic device. When shooting a video, the motion state of the electronic device at the corresponding moment of each frame can be expressed as a vector, that is, a point on the path. Multiple continuous vectors corresponding to multiple continuous image frames constitute the path of the body movement of the electronic device. The optimal path refers to a continuous, smooth, virtual, and ideal path obtained by processing the real path of the electronic device body using algorithms such as filtering or optimization. In addition, the process of calculating the optimal path is path optimization.
其中,在两级电子防抖技术中,一般先由电子设备的机身运动的历史数据预测未来一帧图像的位置。然后再使用当前帧图像的位置、预测得到的未来一帧图像的位置和当前帧图像之前的预设数量的图像的位置进行第一次路径优化,得到一个最优路径。接着,根据预测的未来一帧图像的位置和第一次路径优化后的未来一帧图像对应的位置,得到在对未来一帧图像进行第二次路径优化时的裁剪边界。接着,再使用当前帧图像的位置和当前帧图像之前的预设数量的图像的位置进行第二次路径优化,得到一个最优路径。最后,由当前帧图像的真实位置和第二次路径优化得到的最优路径中所包含的当前帧的理想位置,输出图像,该图像即为防抖处理后的图像。Among them, in the two-level electronic image stabilization technology, the position of the next frame image is generally predicted by the historical data of the body movement of the electronic device. Then, the position of the current frame image, the predicted position of the next frame image, and the position of the preset number of images before the current frame image are used to perform the first path optimization to obtain an optimal path. Then, based on the predicted position of the next frame image and the corresponding position of the next frame image after the first path optimization, the cropping boundary is obtained when the second path optimization is performed on the next frame image. Then, the position of the current frame image and the position of the preset number of images before the current frame image are used to perform the second path optimization to obtain an optimal path. Finally, the image is output based on the actual position of the current frame image and the ideal position of the current frame contained in the optimal path obtained by the second path optimization. This image is the image after the image stabilization process.
由于在预测未来一帧图像的位置时存在误差,而第一次路径优化时是需要使用预测得到的未来一帧图像的位置,这就使得第一次路径优化得到的最优路径也存在误差。随着后续预测得到未来一帧图像的位置的误差的累积,将会导致后续进行路径优化时得到的最优路径变的越来越差,从而导致EIS稳像效果变差,即防抖效果变差。Since there is an error in predicting the position of the next frame of image, and the first path optimization needs to use the predicted position of the next frame of image, the optimal path obtained by the first path optimization also has errors. As the errors in the subsequent predictions of the position of the next frame of image accumulate, the optimal path obtained in the subsequent path optimization will become worse and worse, resulting in a worse EIS stabilization effect, that is, a worse anti-shake effect.
为解决在使用EIS进行防抖时防抖效果较差的问题,本申请实施例提供了一种视频防抖方法。该视频防抖方法可以在使用EIS进行防抖时自适应对第一次路径优化得到的结果进行矫正,从而缓解了第一次路径优化产生的误差累积,进而可以保证能够输出稳定的图像,提升了防抖效果。In order to solve the problem of poor anti-shake effect when using EIS for anti-shake, the embodiment of the present application provides a video anti-shake method. The video anti-shake method can adaptively correct the result obtained by the first path optimization when using EIS for anti-shake, thereby alleviating the error accumulation caused by the first path optimization, and then can ensure that a stable image can be output, thereby improving the anti-shake effect.
示例性的,图1示出了一种电子设备的硬件结构示意图。如图1所示,该电子设备100包括:相机模块110、惯性度量单元(inertial measurement unit,IMU)模块120、处理器130和存储器140。For example, Fig. 1 shows a schematic diagram of the hardware structure of an electronic device. As shown in Fig. 1 , the electronic device 100 includes: a camera module 110, an inertial measurement unit (IMU) module 120, a processor 130 and a memory 140.
其中,相机模块110可以用于采集图像。示例性的,相机模块110可以包括图像传感器111。图像传感器111可以用于生成某时刻的图像,该图像可以由多个像素组成。另外,相机模块110中还可以包括光学防抖(optical image stabilization,OIS)模块112。光学防抖模块112可以在图像传感器111生成图像的过程中,动态调整图像传感器111和相机模块110中镜片(图中未示出)之间的相对位置,以实现机械防抖,同时会输出电子设备100的机身的移动距离。Among them, the camera module 110 can be used to capture images. Exemplarily, the camera module 110 may include an image sensor 111. The image sensor 111 can be used to generate an image at a certain moment, and the image can be composed of multiple pixels. In addition, the camera module 110 may also include an optical image stabilization (OIS) module 112. The optical image stabilization module 112 can dynamically adjust the relative position between the image sensor 111 and the lens (not shown in the figure) in the camera module 110 during the process of the image sensor 111 generating an image to achieve mechanical image stabilization, and at the same time output the moving distance of the body of the electronic device 100.
惯性度量单元模块120可以用于实时记录电子设备100的机身的旋转和平移,输出机身某时刻的位姿(即旋转和平移数据的表示形式),一段时间的位姿即为机身在这段时间的运动路径。示例性的,惯性度量单元模块120可以包括陀螺仪和/或加速度计等。The inertial measurement unit module 120 can be used to record the rotation and translation of the body of the electronic device 100 in real time, and output the body's posture at a certain moment (i.e., the representation of rotation and translation data). The posture over a period of time is the movement path of the body during this period of time. Exemplarily, the inertial measurement unit module 120 may include a gyroscope and/or an accelerometer, etc.
处理器130是电子设备100的计算核心及控制核心。处理器130可以包括一个或多个处理单元。例如,处理器130可以包括应用处理器(application processor,AP)、调制解调器(modem)、图形处理器(graphics processing unit,GPU)、图像信号处理器(imagesignal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signalprocessor,DSP)、基带处理器、和/或神经网络处理器(neural-network processingunit,NPU)等中的一项或多项。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。示例性的,处理器130可以通过图像处理算法对视频图像进行处理,例如处理视频图像的亮度、颜色、像素等。另外,处理器130也可以通过防抖算法对各种数据计算得到画面稳定的图像等。The processor 130 is the computing core and control core of the electronic device 100. The processor 130 may include one or more processing units. For example, the processor 130 may include one or more of an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural network processor (NPU). Among them, different processing units can be independent devices or integrated in one or more processors. Exemplarily, the processor 130 can process the video image through an image processing algorithm, such as processing the brightness, color, pixels, etc. of the video image. In addition, the processor 130 can also calculate various data through an anti-shake algorithm to obtain a stable image.
存储器140可以存储有程序,程序可被处理器130运行,使得处理器130执行本申请提供的方法。存储器140还可以存储有数据。处理器130可以读取存储器140中存储的数据。存储器140和处理器130可以单独设置。可选地,存储器140也可以集成在处理器130中。The memory 140 may store a program, which may be executed by the processor 130 so that the processor 130 executes the method provided in the present application. The memory 140 may also store data. The processor 130 may read the data stored in the memory 140. The memory 140 and the processor 130 may be provided separately. Optionally, the memory 140 may also be integrated in the processor 130.
可以理解的是,本方案图1示意的结构并不构成对电子设备100的具体限定。在本方案另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is understood that the structure shown in FIG. 1 of the present solution does not constitute a specific limitation on the electronic device 100. In other embodiments of the present solution, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
可以理解的是,本申请实施例中,电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digitalassistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备的具体类型不作特殊限制。It can be understood that in the embodiment of the present application, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and/or a smart city device, and the embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.
接下来,基于上文所描述的内容对本申请实施例中提供的视频防抖方法进行详细描述。Next, based on the above description, the video stabilization method provided in the embodiment of the present application is described in detail.
示例性的,图2示出了本申请实施例提供的一种视频防抖方法。其中,该视频防抖方法可以通过上文所描述的图1中的电子设备100执行,也可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行。为便于叙述,下面以图1中的电子设备100为执行主体进行描述。具体地,如图2所示,该方法包括以下步骤:Exemplarily, FIG2 shows a video stabilization method provided by an embodiment of the present application. The video stabilization method can be executed by the electronic device 100 in FIG1 described above, or by any device, equipment, platform, or device cluster with computing and processing capabilities. For ease of description, the following description is based on the electronic device 100 in FIG1 as the execution subject. Specifically, as shown in FIG2, the method includes the following steps:
S201、获取第t帧图像和该第t帧图像对应的第一位置,第一位置由电子设备100在拍摄第t帧图像时的运动数据所表示,t为大于或等于1的正整数。S201. Acquire a t-th frame image and a first position corresponding to the t-th frame image, where the first position is represented by motion data of the electronic device 100 when shooting the t-th frame image, and t is a positive integer greater than or equal to 1.
具体地,电子设备100可以通过其上的图像传感器111获取到第t帧图像,以及通过其上的IMU模块120可以获取到在拍摄第t帧图像时电子设备100的运动数据(比如加速度数据、角速度数据等),进而得到第t帧图像对应的第一位置。Specifically, the electronic device 100 can obtain the tth frame image through the image sensor 111 thereon, and can obtain the motion data (such as acceleration data, angular velocity data, etc.) of the electronic device 100 when taking the tth frame image through the IMU module 120 thereon, and then obtain the first position corresponding to the tth frame image.
S202、将第一位置和在第t帧图像之前的n帧图像的位置输入至未来路径预测模型,得到第(t+1)帧图像的路径的第一预测位置。S202 , input the first position and the positions of n frames of images before the t-th frame of image into a future path prediction model to obtain a first predicted position of the path of the (t+1)-th frame of image.
具体地,获取到第一位置后,可以将第一位置和在第t帧图像之前的n帧图像的位置输入至未来路径预测模型,得到第(t+1)帧图像的路径的第一预测位置。Specifically, after the first position is acquired, the first position and the positions of n frames before the tth frame may be input into a future path prediction model to obtain a first predicted position of the path of the (t+1)th frame.
作为一种可能的实现方式,由于电子设备100上的光学防抖模块112检测到的偏移量也可以反应电子设备100的运动状态,因此还可以将电子设备100上的光学防抖模块112检测到的偏移量也同时输入至未来路径预测模型,以得到第一预测位置,由此以提升路径预测的准确度。As a possible implementation method, since the offset detected by the optical image stabilization module 112 on the electronic device 100 can also reflect the movement state of the electronic device 100, the offset detected by the optical image stabilization module 112 on the electronic device 100 can also be input into the future path prediction model to obtain the first predicted position, thereby improving the accuracy of the path prediction.
S203、根据第一位置、在第t帧图像之前的(n-1)帧图像的位置和第一预测位置,进行第一次路径优化,得到第一最优路径,该第一最优路径中包括第t帧图像之前的(n-1)帧图像、第t帧图像和第(t+1)帧图像均为稳定的图像时各帧图像的理想位置,n为大于或等于1的正整数。S203. Perform a first path optimization based on the first position, the position of the (n-1) frame image before the t-th frame image and the first predicted position to obtain a first optimal path, wherein the first optimal path includes the ideal positions of each frame image when the (n-1) frame image before the t-th frame image, the t-th frame image and the (t+1)-th frame image are all stable images, and n is a positive integer greater than or equal to 1.
具体地,预测出第(t+1)帧图像的路径的第一预测路径后,可以根据第一位置、在第t帧图像之前的n帧图像的位置和第一预测位置,进行第一次路径优化,得到第一最优路径。示例性的,可以将第一位置、在第t帧图像之前的n帧图像的位置和第一预测位置输入至路径优化模型,进行第一次路径优化,并得到第一最优路径。另外,也可以使用滤波算法(比如均值滤波等)对第一位置、在第t帧图像之前的n帧图像的位置和第一预测位置进行处理,以得到第一最优路径。Specifically, after predicting the first predicted path of the path of the (t+1)th frame image, the first path optimization can be performed based on the first position, the position of the n frames before the tth frame image, and the first predicted position to obtain the first optimal path. Exemplarily, the first position, the position of the n frames before the tth frame image, and the first predicted position can be input into the path optimization model to perform the first path optimization and obtain the first optimal path. In addition, a filtering algorithm (such as mean filtering, etc.) can also be used to process the first position, the position of the n frames before the tth frame image, and the first predicted position to obtain the first optimal path.
S204、确定目标帧图像的位置与目标帧图像对应的预测位置之间的目标偏差值是否大于预设偏差阈值,目标帧图像包括第t帧图像和在第t帧图像之前的n帧图像。S204, determining whether a target deviation value between the position of a target frame image and a predicted position corresponding to the target frame image is greater than a preset deviation threshold, the target frame image comprising the t-th frame image and n frames of images before the t-th frame image.
具体地,在进行第一次路径优化后,可以确定目标帧图像的位置与目标帧图像对应的预测位置之间的目标偏差值是否大于预设偏差阈值。其中,目标帧图像包括第t帧图像和在第t帧图像之前的n帧图像。示例性的,可以先确定每帧图像的位置和其所对应的预测位置之间的偏差值,然后再将所有的偏差值的平均值、方差值等作为目标偏差值。Specifically, after the first path optimization is performed, it can be determined whether the target deviation value between the position of the target frame image and the predicted position corresponding to the target frame image is greater than a preset deviation threshold. The target frame image includes the t-th frame image and the n-th frame image before the t-th frame image. Exemplarily, the deviation value between the position of each frame image and its corresponding predicted position can be determined first, and then the average value, variance value, etc. of all the deviation values are used as the target deviation value.
当目标偏差值大于预设偏差阈值时,表明第一次路径优化得到的第一最优路径中第(t+1)帧图像对应的理想位置与其真实的路径之间的偏差较大,此时需要对中第(t+1)帧图像对应的理想位置进行矫正,即执行S205。否则,则执行S206。When the target deviation value is greater than the preset deviation threshold, it indicates that the deviation between the ideal position corresponding to the (t+1)th frame image in the first optimal path obtained by the first path optimization and its actual path is large, and at this time, the ideal position corresponding to the (t+1)th frame image needs to be corrected, that is, S205 is executed. Otherwise, S206 is executed.
S205、利用目标误差矫正量,对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正。S205 , using the target error correction amount, correcting the first ideal position corresponding to the (t+1)th frame image in the first optimal path.
具体地,可以使用预先设定的误差矫正量对第一最优路径中第(t+1)帧图像对应的第一理想位置进行矫正。Specifically, a preset error correction amount may be used to correct the first ideal position corresponding to the (t+1)th frame image in the first optimal path.
另外,也可以使用对第(t-1)帧图像进行第二次路径优化得到的最优路径中第(t-1)帧图像的理想位置和进行第一次路径优化得到的最优路径中第(t-1)帧图像的理想位置之间的差进行矫正。也即是说,可以使用目标误差矫正量可以为预设值,也可以为对第(t-1)帧图像进行第二次路径优化得到的最优路径中第(t-1)帧图像的理想位置和进行第一次路径优化得到的最优路径中第(t-1)帧图像的理想位置之间的差。In addition, the correction may be performed using the difference between the ideal position of the (t-1)th frame image in the optimal path obtained by performing the second path optimization on the (t-1)th frame image and the ideal position of the (t-1)th frame image in the optimal path obtained by performing the first path optimization. That is, the target error correction amount may be a preset value or the difference between the ideal position of the (t-1)th frame image in the optimal path obtained by performing the second path optimization on the (t-1)th frame image and the ideal position of the (t-1)th frame image in the optimal path obtained by performing the first path optimization.
在一个例子中,还可以根据第一理想位置和第一预测位置,确定第(t+1)帧图像对应的收缩边界。具体地,可以根据第一理想位置和第一预测位置,确定出第(t+1)帧图像对应的收缩边界。示例性的,收缩边界可以为预设的边界阈值减去第一理想位置与第一预测位置之间的绝对值所得到的数据。另外,各帧图像对应的收缩边界可以用于在对该帧图像进行处理时(比如进行第二次路径优化时)对该帧图像进行裁剪,以减少图像的存储量和计算量,提升处理效率。示例性的,预设的边界阈值可以为在对待处理的一帧图像进行第一次路径优化时对该帧图像进行裁剪的边界。In one example, the shrinkage boundary corresponding to the (t+1)th frame image can also be determined based on the first ideal position and the first predicted position. Specifically, the shrinkage boundary corresponding to the (t+1)th frame image can be determined based on the first ideal position and the first predicted position. Exemplarily, the shrinkage boundary can be data obtained by subtracting the absolute value between the first ideal position and the first predicted position from a preset boundary threshold. In addition, the shrinkage boundary corresponding to each frame image can be used to crop the frame image when processing the frame image (such as when performing a second path optimization) to reduce the image storage and calculation amount and improve processing efficiency. Exemplarily, the preset boundary threshold can be the boundary for cropping the frame image when performing the first path optimization on the frame image to be processed.
S206、根据第一位置和在第t帧图像之前的n帧图像的位置,进行第二次路径优化,得到第二最优路径,第二最优路径中包括第t帧图像之前的(n-1)帧图像和第t帧图像均为稳定的图像时各帧图像的理想位置。S206. Perform a second path optimization based on the first position and the positions of n frames before the t-th frame to obtain a second optimal path, wherein the second optimal path includes the ideal positions of each frame when the (n-1) frames before the t-th frame and the t-th frame are stable images.
具体地,可以根据第一位置和在第t帧图像之前的n帧图像的位置,进行第二次路径优化,得到第二最优路径。其中,第二最优路径中包括第t帧图像之前的(n-1)帧图像和第t帧图像均为稳定的图像时各帧图像的理想位置。示例性的,可以将第一位置和在第t帧图像之前的n帧图像的位置输入至路径优化模型,进行第一次路径优化,并得到第二最优路径。另外,也可以使用滤波算法(比如均值滤波等)对第一位置和在第t帧图像之前的n帧图像的位置进行处理,以得到第二最优路径。Specifically, a second path optimization can be performed based on the first position and the position of the n-frame images before the t-th frame image to obtain a second optimal path. The second optimal path includes the ideal positions of each frame image when the (n-1)-frame image before the t-th frame image and the t-th frame image are both stable images. Exemplarily, the first position and the position of the n-frame image before the t-th frame image can be input into the path optimization model, the first path optimization is performed, and the second optimal path is obtained. In addition, a filtering algorithm (such as mean filtering, etc.) can also be used to process the first position and the position of the n-frame image before the t-th frame image to obtain the second optimal path.
S207、根据第一位置和第二最优路径中第t帧图像对应的第二理想位置,对第t帧图像进行处理,得到稳定的图像。S207 . Process the t-th frame image according to the first position and the second ideal position corresponding to the t-th frame image in the second optimal path to obtain a stable image.
具体地,得到第二最优路径后,可以根据第一位置和第二最优路径中第t帧图像对应的第二理想位置,对第t帧图像进行处理,得到稳定的图像。示例性的,可以将第位置和第二理想位置输入至罗德里格斯旋转矩阵公式,得到第t帧图像上的像素坐标变化前后的关系即坐标变换的矩阵,进而可以对第t帧图像的像素做移动,并输出稳定的图像,从而达到EIS防抖的目的。可以理解的是,由于EIS采用的是基于位置到最优路径的运动状态变换得到画面像素移动变换的软件算法,而由运动状态变换计算像素移动变换的公式即为罗德里格斯旋转矩阵公式,所以可以通过罗德里格斯旋转矩阵公式得到稳定的图像。Specifically, after obtaining the second optimal path, the t-th frame image can be processed according to the second ideal position corresponding to the t-th frame image in the first position and the second optimal path to obtain a stable image. Exemplarily, the t-th frame image and the second ideal position can be input into the Rodriguez rotation matrix formula to obtain the relationship between the pixel coordinates on the t-th frame image before and after the change, that is, the matrix of the coordinate transformation, and then the pixels of the t-th frame image can be moved, and a stable image can be output, thereby achieving the purpose of EIS anti-shake. It can be understood that since EIS adopts a software algorithm that obtains the pixel movement transformation of the picture based on the motion state transformation from the position to the optimal path, and the formula for calculating the pixel movement transformation from the motion state transformation is the Rodriguez rotation matrix formula, a stable image can be obtained by the Rodriguez rotation matrix formula.
由此,本申请实施例提供的视频防抖方法中,在使用EIS防抖技术过程中,采用自适应误差矫正技术,动态调整第一次路径优化结果,从而消除了在进行第一次路径优化时误差累积问题,提升两级防抖稳像效果。Therefore, in the video stabilization method provided in the embodiment of the present application, in the process of using the EIS stabilization technology, an adaptive error correction technology is adopted to dynamically adjust the first path optimization result, thereby eliminating the error accumulation problem during the first path optimization and improving the two-level stabilization effect.
以上即是对本申请实施例提供的视频防抖方法的描述,为便于理解下面举例进行说明。The above is a description of the video stabilization method provided in the embodiment of the present application. For ease of understanding, the following examples are given for illustration.
示例性的,图3示出了一种视频防抖方法的过程示意图。如图3所示,具体包括以下步骤:For example, Fig. 3 shows a schematic diagram of a video anti-shake method. As shown in Fig. 3, the method specifically includes the following steps:
S301、初始化。S301: Initialization.
具体地,初始化可以包括:误差矫正量Δs,矫正开启阈值e,矫正量缩放比例参数α,相机内参矩阵K,优化边界阈值σ,罗德里格斯公式R等。Specifically, the initialization may include: error correction amount Δs, correction start threshold e, correction amount scaling parameter α, camera intrinsic parameter matrix K, optimized boundary threshold σ, Rodriguez formula R, etc.
其中,矫正量缩放比例参数α可以理解为矫正的力度;当矫正量缩放比例参数α大时,则矫正力度大,当矫正量缩放比例参数α小时,则矫正力度小。Among them, the correction amount scaling parameter α can be understood as the strength of correction; when the correction amount scaling parameter α is large, the correction strength is large, and when the correction amount scaling parameter α is small, the correction strength is small.
相机内参矩阵K是由电子设备上的相机本身物理特性决定的参数,可由经典相机标定算法(如张正友标定法)得到。The camera intrinsic parameter matrix K is a parameter determined by the physical characteristics of the camera itself on the electronic device, and can be obtained by a classic camera calibration algorithm (such as Zhang Zhengyou calibration method).
优化边界阈值σ是在使用EIS算法过程中需要剪裁的裁剪比例。由于EIS算法的实质是移动输入图像的像素,移动像素后,整幅图像不是规则的矩形,而需要输出规定分辨率的矩形,所以需要对边界做裁剪,这个裁剪比例即为边界阈值参数。The optimized boundary threshold σ is the cropping ratio that needs to be cropped when using the EIS algorithm. Since the essence of the EIS algorithm is to move the pixels of the input image, after moving the pixels, the entire image is not a regular rectangle, but needs to output a rectangle of a specified resolution, so the boundary needs to be cropped, and this cropping ratio is the boundary threshold parameter.
在一个例子中,S301并不是每次必须要执行,其可以根据实际情况进行选择,此处不做限定。In one example, S301 does not have to be executed every time, and it can be selected according to actual conditions, which is not limited here.
S302、获取第t帧图像和对应的位置/> S302: Obtain the tth frame image and the corresponding position/>
S303、未来1帧位置预测,得到未来1帧的位置 S303: Predict the position of the next frame to obtain the position of the next frame
具体地,将第t帧图像和对应位置/>以及第t帧图像前的n个图像的位置做为输入,输入至预先训练好的未来路径预测模型,得到预测的未来1帧的位置/>示例性的,以n=29为例,则是将/>输入至预先训练好的未来路径预测模型,得到预测的未来1帧的位置/> Specifically, the t-th frame image and the corresponding position/> And the positions of n images before the t-th frame image are used as input to the pre-trained future path prediction model to obtain the predicted position of the next frame/> For example, taking n=29 as an example, it is to set/> Input into the pre-trained future path prediction model to get the predicted position of the next frame/>
S304、第一次路径优化。S304: First path optimization.
具体地,将第t帧图像对应的位置第t帧图像前的(n-1)个图像的位置、未来1帧的位置/>作为输入,做第一次路径优化,得到第一次优化的最优路径,该最优路径中包含第t帧图像的理想位置和未来1帧图像的理想位置。示例性的,以n=29为例,则做为输入的位置为/>做第一次路径优化时,各帧边界阈值均为σ,输出的第一次优化的最优路径为/> Specifically, the position corresponding to the t-th frame image The position of the (n-1)th image before the t-th frame, the position of the next frame/> As input, the first path optimization is performed to obtain the optimal path of the first optimization, which includes the ideal position of the t-th frame image and the ideal position of the next frame image. For example, taking n=29 as an example, the position used as input is / > When performing the first path optimization, the boundary threshold of each frame is σ, and the optimal path output for the first optimization is/>
在一个例子中,在进行第一次路径优化时,可以采用初始化时的优化边界阈值σ对进行第t帧图像裁剪,以减轻后续处理的计算量,提升处理效率。In one example, when performing the first path optimization, the optimized boundary threshold σ at the time of initialization can be used to perform the t-th frame image Clipping can reduce the amount of computation in subsequent processing and improve processing efficiency.
S305、判断矫正是否开启。S305: Determine whether correction is turned on.
具体地,可以计算包含第t帧的(n+1)个帧图像的位置与相应的预测位置之间的差值,然后再由该差值判断是否开启矫正。示例性的,以n=29为例,预测平均误差 若该误差大于开启阈值e,则执行S306,否则跳过步骤S306。Specifically, the difference between the position of the (n+1) frame image including the tth frame and the corresponding predicted position can be calculated, and then the difference is used to determine whether to start the correction. For example, taking n=29 as an example, the predicted average error If the error is greater than the opening threshold e, step S306 is executed, otherwise step S306 is skipped.
S306、矫正第一次最优路径中未来1帧的理想位置。S306: Correct the ideal position of the next frame in the first optimal path.
具体地,可以使用初始化误差矫正量Δs和矫正量缩放比例参数α对第一次得到的最优路径中未来1帧的理想位置进行矫正。示例性的,矫正后的第一次最优路径中未来一帧的理想位置 Specifically, the initialization error correction amount Δs and the correction amount scaling parameter α can be used to correct the ideal position of the next frame in the first optimal path obtained. For example, the ideal position of the next frame in the first optimal path after correction is
S307、得到未来1帧图像的收缩边界。S307: Obtain the shrinkage boundary of the next frame of image.
具体地,由于EIS算法的实质是移动输入图像的像素,移动像素后,整幅图像不是规则的矩形,而需要输出规定分辨率的矩形,所以需要对边界做裁剪。此外,在两级防抖中执行了第一次路径优化,使用了部分可裁剪的边界,那么在做第二次路径优化时,可裁剪的边界范围减少,因此需要收缩边界。Specifically, since the essence of the EIS algorithm is to move the pixels of the input image, after moving the pixels, the entire image is not a regular rectangle, but needs to output a rectangle of a specified resolution, so the border needs to be cropped. In addition, in the two-level anti-shake, the first path optimization is performed, and part of the croppable border is used. Then, when performing the second path optimization, the croppable border range is reduced, so the border needs to be shrunk.
其中,可以根据在处理(t-1)帧图像时预测得到的第t帧的位置和在处理(t-1)帧图像时矫正后的第一次最优路径/>收缩第t帧的边界阈值。新边界阈值 此外,此时也可以收缩第(t+1)帧图像的边界阈值,以便于后续处理第(t+1)帧图像。其中,第(t+1)帧图像的边界阈值为/>其中,σt+1可以为初始化时的优化边界阈值σ。Among them, the position of the t-th frame predicted when processing the (t-1) frame image can be and the first corrected optimal path when processing the (t-1) frame image/> Shrink the boundary threshold of frame t. New boundary threshold In addition, the boundary threshold of the (t+1)th frame image can also be shrunk at this time to facilitate the subsequent processing of the (t+1)th frame image. The boundary threshold of the (t+1)th frame image is Wherein, σ t+1 may be the optimization boundary threshold σ during initialization.
S308、第二次路径优化。S308: Second path optimization.
具体地,将第t帧图像对应的位置第t帧图像前的n个图像的位置作为输入,做第二次路径优化,得到第二次优化的最优路径,该最优路径中包含第t帧图像的的理想位置。示例性的,以n=29为例,则做为输入的位置为/>做第二次路径优化时,各帧边界阈值分别是(∈t-29,…,∈t-1,∈t),输出的第二次优化的最优路径 Specifically, the position corresponding to the t-th frame image The positions of n images before the t-th frame image are used as input, and the second path optimization is performed to obtain the optimal path of the second optimization, which includes the ideal position of the t-th frame image. For example, taking n=29 as an example, the position used as input is / > When performing the second path optimization, the boundary thresholds of each frame are (∈ t-29 ,…,∈ t-1 ,∈ t ), and the optimal path of the second optimization is outputted
在一个例子中,在进行第二次路径优化时,可以采用在对第(t-1)帧图像进行处理时得到的第t帧图像的收缩边界∈t对经过第一次路径优化后被裁剪的第t帧图像再次进行裁剪,以减轻后续处理的计算量,提升处理效率。In one example, when performing the second path optimization, the contraction boundary ∈ t of the t-th frame image obtained when processing the (t-1)-th frame image can be used to crop the t-th frame image after the first path optimization. Perform cropping again to reduce the amount of computation required for subsequent processing and improve processing efficiency.
S309、计算误差矫正量。S309: Calculate the error correction amount.
具体地,可以以两次路径优化的最优路径中第t帧图像对应的位置差异为误差矫正量其中,此处计算得到的误差矫正量为处理下一帧图像时的误差矫正量。Specifically, the position difference corresponding to the t-th frame image in the optimal path of the two path optimizations can be used as the error correction amount: The error correction amount calculated here is the error correction amount when processing the next frame of image.
S310、输出防抖图像。S310: Outputting an anti-shake image.
具体地,得到当前第t帧图像对应的防抖最优路径中的位置后,可以利用罗德里格斯旋转矩阵公式R和相机内参矩阵等,对第t帧图像的防抖最优路径/>和其真实位置/>进行处理,得到变换矩阵/>然后,再将得到的变换矩阵H作用在第t帧图像/>上即可以得到稳定图像/> Specifically, the position in the optimal anti-shake path corresponding to the current t-th frame image is obtained. After that, the optimal anti-shake path for the t-th frame image can be obtained by using the Rodriguez rotation matrix formula R and the camera internal parameter matrix. and its real location/> Processing, get the transformation matrix/> Then, the obtained transformation matrix H is applied to the t-th frame image/> You can get a stable image by
最后,在输出防抖图像后,可以跳转到S302,循环处理下一帧。具体地,处理完第t帧图像后,即可以开始处理第(t+1)帧图像。跳转到S302时可以将t更新为(t+1)。Finally, after outputting the anti-shake image, the process may jump to S302 to loop through the next frame. Specifically, after processing the tth frame image, the process may start to process the (t+1)th frame image. When jumping to S302, t may be updated to (t+1).
示例性的,图4示出了另一种视频防抖方法的过程示意图。图4与图3的不同之处主要是在于图4中在预测未来一帧图像的路径时加入了电子设备上的OIS模块检测到的偏移量。For example, another process diagram of a video anti-shake method is shown in Fig. 4. The main difference between Fig. 4 and Fig. 3 is that the offset detected by the OIS module on the electronic device is added when predicting the path of a future frame of image in Fig. 4.
如图4所示,具体包括以下步骤:As shown in FIG4 , the specific steps include:
S401、初始化。S401: Initialization.
具体地,初始化可以包括:初始化误差矫正量Δs,矫正开启阈值e,矫正量缩放比例参数α,相机内参矩阵K,优化边界阈值σ,罗德里格斯公式R等。Specifically, the initialization may include: initializing the error correction amount Δs, the correction start threshold e, the correction amount scaling parameter α, the camera intrinsic parameter matrix K, the optimization boundary threshold σ, the Rodriguez formula R, etc.
在一个例子中,S401并不是每次必须要执行,其可以根据实际情况进行选择,此处不做限定。In one example, S401 does not have to be executed every time, and it can be selected according to actual conditions, which is not limited here.
S402、获取第t帧图像和对应的位置/> S402: Obtaining the tth frame image and the corresponding position/>
S403、OIS偏移量引导未来1帧路径预测,得到未来1帧的位置 S403: OIS offset guides the path prediction for the next frame to obtain the position of the next frame
具体地,将第t帧图像和对应位置/>第t帧图像前的n个图像的位置和电子设备上的OIS模块检测到的偏移量f做为输入,输入至预先训练好的未来路径预测模型,得到预测的未来1帧的位置/>示例性的,以n=29为例,则是将/>输入至预先训练好的未来路径预测模型,得到预测的未来1帧的位置/> Specifically, the t-th frame image and the corresponding position/> The positions of n images before the t-th frame image and the offset f detected by the OIS module on the electronic device are used as input to the pre-trained future path prediction model to obtain the predicted position of the next frame/> For example, taking n=29 as an example, it is to set/> Input into the pre-trained future path prediction model to get the predicted position of the next frame/>
S404、第一次路径优化。S404: First path optimization.
具体地,将第t帧图像对应的位置第t帧图像前的(n-1)个图像的位置、未来1帧的位置/>作为输入,做第一次路径优化,得到第一次优化的最优路径,该最优路径中包含第t帧图像的理想位置和未来1帧图像的理想位置。示例性的,以n=29为例,则做为输入的位置为/>做第一次路径优化时,各帧边界阈值均为σ,输出的第一次优化的最优路径为/> Specifically, the position corresponding to the t-th frame image The position of the (n-1)th image before the t-th frame, the position of the next frame/> As input, the first path optimization is performed to obtain the optimal path of the first optimization, which includes the ideal position of the t-th frame image and the ideal position of the next frame image. For example, taking n=29 as an example, the position used as input is / > When performing the first path optimization, the boundary threshold of each frame is σ, and the optimal path output for the first optimization is/>
在一个例子中,在进行第一次路径优化时,可以采用初始化时的优化边界阈值σ对进行第t帧图像裁剪,以减轻后续处理的计算量,提升处理效率。In one example, when performing the first path optimization, the optimized boundary threshold σ at the time of initialization can be used to perform the t-th frame image Clipping can reduce the amount of computation in subsequent processing and improve processing efficiency.
S405、判断矫正是否开启。S405: Determine whether correction is enabled.
具体地,可以计算包含第t帧的(n+1)个帧图像的位置与相应的预测位置之间的差值,然后再由该差值判断是否开启矫正。示例性的,以n=29为例,预测平均误差 若该误差大于开启阈值e,则执行S406,否则跳过步骤S406。Specifically, the difference between the position of the (n+1) frame image including the tth frame and the corresponding predicted position can be calculated, and then the difference is used to determine whether to start the correction. For example, taking n=29 as an example, the predicted average error If the error is greater than the opening threshold e, step S406 is executed, otherwise step S406 is skipped.
S406、矫正第一次最优路径S406, correcting the first optimal path
具体地,可以使用初始化误差矫正量Δs和矫正量缩放比例参数α对第一次得到的最优路径中未来1帧的理想位置进行矫正。示例性的,矫正后的第一次最优路径中未来一帧的理想位置 Specifically, the initialization error correction amount Δs and the correction amount scaling parameter α can be used to correct the ideal position of the next frame in the first optimal path obtained. For example, the ideal position of the next frame in the first optimal path after correction is
S407、得到未来1帧图像的收缩边界。S407: Obtain the shrinkage boundary of the next frame of image.
具体地,由于EIS算法的实质是移动输入图像的像素,移动像素后,整幅图像不是规则的矩形,而我们需要输出规定分辨率的矩形,所以需要对边界做裁剪。此外,在两级防抖中执行了第一次路径优化,使用了部分可裁剪的边界,那么在做第二次路径优化时,可裁剪的边界范围减少,因此需要收缩边界。Specifically, since the essence of the EIS algorithm is to move the pixels of the input image, after moving the pixels, the entire image is not a regular rectangle, and we need to output a rectangle with a specified resolution, so we need to crop the border. In addition, in the two-level anti-shake, the first path optimization is performed, and part of the croppable border is used. Then, when performing the second path optimization, the croppable border range is reduced, so the border needs to be shrunk.
其中,可以根据在处理(t-1)帧图像时预测得到的第t帧的位置和在处理(t-1)帧图像时矫正后的第一次最优路径/>收缩第t帧的边界阈值。新边界阈值 此外,此时也可以收缩第(t+1)帧图像的边界阈值,以便于后续处理第(t+1)帧图像。其中,第(t+1)帧图像的边界阈值为/>其中,σt+1可以为初始化时的优化边界阈值σ。Among them, the position of the t-th frame predicted when processing the (t-1) frame image can be and the first corrected optimal path when processing the (t-1) frame image/> Shrink the boundary threshold of frame t. New boundary threshold In addition, the boundary threshold of the (t+1)th frame image can also be shrunk at this time to facilitate the subsequent processing of the (t+1)th frame image. The boundary threshold of the (t+1)th frame image is Wherein, σ t+1 may be the optimization boundary threshold σ during initialization.
S408、第二次路径优化。S408: Second path optimization.
具体地,将第t帧图像对应的位置第t帧图像前的n个图像的位置作为输入,做第二次路径优化,得到第二次优化的最优路径,该最优路径中包含第t帧图像的的理想位置。示例性的,以n=29为例,则做为输入的位置为/>做第二次路径优化时,各帧边界阈值分别是(∈t-29,…,∈t-1,∈t),输出的第二次优化的最优路径其中,最优路径中的各个值为各帧图像对应的理想位置。Specifically, the position corresponding to the t-th frame image The positions of n images before the t-th frame image are used as input, and the second path optimization is performed to obtain the optimal path of the second optimization, which includes the ideal position of the t-th frame image. For example, taking n=29 as an example, the position used as input is / > When performing the second path optimization, the boundary thresholds of each frame are (∈ t-29 ,…,∈ t-1 ,∈ t ), and the optimal path of the second optimization is outputted Among them, each value in the optimal path is the ideal position corresponding to each frame image.
在一个例子中,在进行第二次路径优化时,可以采用在对第(t-1)帧图像进行处理时得到的第t帧图像的收缩边界∈t对经过第一次路径优化后被裁剪的第t帧图像再次进行裁剪,以减轻后续处理的计算量,提升处理效率。In one example, when performing the second path optimization, the contraction boundary ∈ t of the t-th frame image obtained when processing the (t-1)-th frame image can be used to crop the t-th frame image after the first path optimization. Perform cropping again to reduce the amount of computation required for subsequent processing and improve processing efficiency.
S409、计算误差矫正量。S409: Calculate the error correction amount.
具体地,可以以两次路径优化的最优路径中第t帧图像对应的位置差异为误差矫正量其中,此处计算得到的误差矫正量为处理下一帧图像时的误差矫正量。Specifically, the position difference corresponding to the t-th frame image in the optimal path of the two path optimizations can be used as the error correction amount: The error correction amount calculated here is the error correction amount when processing the next frame of image.
S410、输出防抖图像。S410: Outputting an anti-shake image.
具体地,得到当前第t帧图像对应的防抖最优路径中的位置后,可以利用罗德里格斯旋转矩阵公式R和相机内参矩阵等,对第t帧图像的防抖最优路径/>和其真实位置/>进行处理,得到变换矩阵/>然后,再将得到的变换矩阵H作用在第t帧图像/>上即可以得到稳定图像/> Specifically, the position in the optimal anti-shake path corresponding to the current t-th frame image is obtained. After that, the optimal anti-shake path for the t-th frame image can be obtained by using the Rodriguez rotation matrix formula R and the camera internal parameter matrix. and its real location/> Processing, get the transformation matrix/> Then, the obtained transformation matrix H is applied to the t-th frame image/> You can get a stable image by
最后,在输出防抖图像后,可以跳转到S402,循环处理下一帧。具体地,处理完第t帧图像后,即可以开始处理第(t+1)帧图像。跳转到S402时可以将t更新为(t+1)。Finally, after outputting the anti-shake image, the process may jump to S402 to loop through the next frame. Specifically, after processing the tth frame image, the process may start to process the (t+1)th frame image. When jumping to S402, t may be updated to (t+1).
可以理解的是,本申请的任意实施例中提供的方法,除了通过电子设备100执行外,也可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行,其中,除电子设备100之外的执行主体执行的方式也在本申请的保护范围之内。此外,本申请的任意实施例中的各个步骤的执行顺序在不矛盾的前提下,可根据实际情况进行调整,调整后的技术方案也在本申请的范围之内。此外,本申请的任意实施例中的各个步骤也可以选择性执行,此处不做限定。另外,本申请的任意实施例的任意特征的全部或部分在不矛盾的前提下,可以自由地、任何地组合,组合后的技术方案也在本申请的保护范围之内。It is understandable that the method provided in any embodiment of the present application, in addition to being executed by the electronic device 100, can also be executed by any device, equipment, platform, and device cluster with computing and processing capabilities, wherein the execution method of the execution subject other than the electronic device 100 is also within the protection scope of the present application. In addition, the execution order of each step in any embodiment of the present application can be adjusted according to the actual situation without contradiction, and the adjusted technical solution is also within the scope of the present application. In addition, the various steps in any embodiment of the present application can also be selectively executed, which is not limited here. In addition, all or part of any features of any embodiment of the present application can be freely and arbitrarily combined without contradiction, and the combined technical solution is also within the protection scope of the present application.
基于上述实施例中的方法,本申请实施例还提供了一种视频防抖装置。请参阅图5,图5为本申请实施例提供的一种视频防抖装置的结构示意图。如图5所示,视频防抖装置500包括一个或多个处理器501以及接口电路502。可选的,视频防抖装置500还可以包含总线503。Based on the method in the above embodiment, the embodiment of the present application further provides a video anti-shake device. Please refer to FIG. 5, which is a schematic diagram of the structure of a video anti-shake device provided in the embodiment of the present application. As shown in FIG. 5, the video anti-shake device 500 includes one or more processors 501 and an interface circuit 502. Optionally, the video anti-shake device 500 may also include a bus 503.
其中:in:
处理器501可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器、数字通信器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。接口电路502可以用于数据、指令或者信息的发送或者接收,处理器501可以利用接口电路502接收的数据、指令或者其它信息,进行加工,可以将加工完成信息通过接口电路502发送出去。Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in processor 501 or an instruction in software form. The above-mentioned processor 501 can be a general-purpose processor, a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods and steps in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The interface circuit 502 can be used for sending or receiving data, instructions or information, and the processor 501 can use the data, instructions or other information received by the interface circuit 502 to process, and the processing completion information can be sent out through the interface circuit 502.
可选的,视频防抖装置还包括存储器,存储器可以包括只读存储器和随机存取存储器,并向处理器提供操作指令和数据。存储器的一部分还可以包括非易失性随机存取存储器(NVRAM)。可选的,存储器存储了可执行软件模块或者数据结构,处理器可以通过调用存储器存储的操作指令(该操作指令可存储在操作系统中),执行相应的操作。Optionally, the video stabilization device further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory (NVRAM). Optionally, the memory stores an executable software module or a data structure, and the processor may perform a corresponding operation by calling an operation instruction stored in the memory (the operation instruction may be stored in the operating system).
可选的,接口电路502可用于输出处理器501的执行结果。Optionally, the interface circuit 502 may be used to output the execution result of the processor 501 .
需要说明的,处理器501、接口电路502各自对应的功能既可以通过硬件设计实现,也可以通过软件设计来实现,还可以通过软硬件结合的方式来实现,这里不作限制。It should be noted that the functions corresponding to the processor 501 and the interface circuit 502 can be implemented through hardware design, software design, or a combination of hardware and software, which is not limited here.
应理解,上述方法实施例的各步骤可以通过处理器中的硬件形式的逻辑电路或者软件形式的指令完成。其中,该视频防抖装置可应用于上述图2中的电子设备100中,以实现本申请实施例中提供的方法。It should be understood that each step of the above method embodiment can be completed by a hardware logic circuit or a software instruction in a processor. Among them, the video anti-shake device can be applied to the electronic device 100 in Figure 2 above to implement the method provided in the embodiment of the present application.
可以理解的是,本申请的实施例中的处理器可以是中央处理单元(centralprocessing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signalprocessor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。It is understandable that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器(erasablePROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111285418.8A CN116095484B (en) | 2021-10-29 | 2021-10-29 | Video anti-shake method and device and electronic equipment |
PCT/CN2022/112824 WO2023071428A1 (en) | 2021-10-29 | 2022-08-16 | Video anti-shake method and apparatus, and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111285418.8A CN116095484B (en) | 2021-10-29 | 2021-10-29 | Video anti-shake method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116095484A CN116095484A (en) | 2023-05-09 |
CN116095484B true CN116095484B (en) | 2024-04-09 |
Family
ID=86159025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111285418.8A Active CN116095484B (en) | 2021-10-29 | 2021-10-29 | Video anti-shake method and device and electronic equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116095484B (en) |
WO (1) | WO2023071428A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119946414B (en) * | 2025-04-07 | 2025-06-17 | 安徽聆思智能科技有限公司 | Video anti-shake method, device, storage medium and processor |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1744674A (en) * | 2005-10-09 | 2006-03-08 | 北京中星微电子有限公司 | A method for video electronic anti-shake |
JP2008104223A (en) * | 2007-12-03 | 2008-05-01 | Sharp Corp | Hand shaking correction device |
CN110062165A (en) * | 2019-04-22 | 2019-07-26 | 联想(北京)有限公司 | Method for processing video frequency, device and the electronic equipment of electronic equipment |
JP2020120362A (en) * | 2019-01-28 | 2020-08-06 | キヤノン株式会社 | Image processing device, image processing method, and program |
CN113436113A (en) * | 2021-07-22 | 2021-09-24 | 黑芝麻智能科技有限公司 | Anti-shake image processing method, device, electronic equipment and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4079375B2 (en) * | 2004-10-28 | 2008-04-23 | シャープ株式会社 | Image stabilizer |
US7755667B2 (en) * | 2005-05-17 | 2010-07-13 | Eastman Kodak Company | Image sequence stabilization method and camera having dual path image sequence stabilization |
JP6448218B2 (en) * | 2014-05-12 | 2019-01-09 | キヤノン株式会社 | IMAGING DEVICE, ITS CONTROL METHOD, AND INFORMATION PROCESSING SYSTEM |
JP6736362B2 (en) * | 2016-06-03 | 2020-08-05 | キヤノン株式会社 | Image processing device, image processing method, and program |
US10545215B2 (en) * | 2017-09-13 | 2020-01-28 | Google Llc | 4D camera tracking and optical stabilization |
US11006044B1 (en) * | 2020-03-03 | 2021-05-11 | Qualcomm Incorporated | Power-efficient dynamic electronic image stabilization |
CN113286076B (en) * | 2021-04-09 | 2022-12-06 | 华为技术有限公司 | Shooting method and related equipment |
-
2021
- 2021-10-29 CN CN202111285418.8A patent/CN116095484B/en active Active
-
2022
- 2022-08-16 WO PCT/CN2022/112824 patent/WO2023071428A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1744674A (en) * | 2005-10-09 | 2006-03-08 | 北京中星微电子有限公司 | A method for video electronic anti-shake |
JP2008104223A (en) * | 2007-12-03 | 2008-05-01 | Sharp Corp | Hand shaking correction device |
JP2020120362A (en) * | 2019-01-28 | 2020-08-06 | キヤノン株式会社 | Image processing device, image processing method, and program |
CN110062165A (en) * | 2019-04-22 | 2019-07-26 | 联想(北京)有限公司 | Method for processing video frequency, device and the electronic equipment of electronic equipment |
CN113436113A (en) * | 2021-07-22 | 2021-09-24 | 黑芝麻智能科技有限公司 | Anti-shake image processing method, device, electronic equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
Optimum Motion Estimation Algorithm for Fast and Robust Digital Image Stabilization;Haruhisa Okuda;《EEE Transactions on Consumer Electronics》;第52卷(第1期);全文 * |
视频稳像优化算法研究;瞿晖;《优秀硕士论文》;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN116095484A (en) | 2023-05-09 |
WO2023071428A1 (en) | 2023-05-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8274570B2 (en) | Image processing apparatus, image processing method, hand shake blur area estimation device, hand shake blur area estimation method, and program | |
CN110678898B (en) | Video anti-shake method and mobile device | |
US20130287304A1 (en) | Image processing device, image processing method, and program | |
JP5189678B2 (en) | Image stabilization apparatus and method for moving image | |
CN113556464B (en) | Shooting method and device and electronic equipment | |
CN110661977A (en) | Subject detection method and apparatus, electronic device, computer-readable storage medium | |
WO2013151873A1 (en) | Joint video stabilization and rolling shutter correction on a generic platform | |
US20140307112A1 (en) | Motion Adaptive Cropping for Video Stabilization | |
KR20130037746A (en) | Photographing apparatus, motion estimation apparatus, method for image compensation, method for motion estimation, computer-readable recording medium | |
CN110475067A (en) | Image processing method and device, electronic equipment, computer readable storage medium | |
CN114390188B (en) | Image processing method and electronic equipment | |
CN111372000A (en) | Video anti-shake method and apparatus, electronic device and computer-readable storage medium | |
CN116095484B (en) | Video anti-shake method and device and electronic equipment | |
CN112734653B (en) | Motion smoothing method, device and equipment for video image and storage medium | |
CN115705651A (en) | Video motion estimation method, device, equipment and computer readable storage medium | |
JP6282133B2 (en) | Imaging device, control method thereof, and control program | |
KR101012481B1 (en) | Video stabilization device and method | |
CN113286084A (en) | Terminal image acquisition method and device, storage medium and terminal | |
CN113807124B (en) | Image processing method, device, storage medium and electronic equipment | |
JP6316030B2 (en) | Imaging apparatus and control method thereof | |
CN113436085A (en) | Anti-shake effect evaluation method and device, computer equipment and storage medium | |
CN113763437B (en) | Image processing method, device, electronic equipment and storage medium | |
CN112804444A (en) | Video processing method and device, computing equipment and storage medium | |
CN113923340B (en) | Video processing method, terminal and storage medium | |
EP2747417B1 (en) | Combined rectification and video stabilisation |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |