Image processing method, device and shooting equipment

By using an inertial measurement unit and a Kalman filter algorithm in the shooting equipment, the problem of poor anti-shake effect in the existing technology is solved and higher-quality video shooting effects are achieved.

CN117750202BActive Publication Date: 2024-10-01LABPANO TECHNOLOGY (CHANGZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311863104.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-10-01
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

The anti-shake effect of existing shooting equipment is poor, resulting in unclear videos.

Method used

By setting up an inertial measurement unit in the shooting equipment, obtaining attitude data and using the Kalman filter algorithm for state estimation and covariance matrix update, hysteresis smoothing of the image is achieved, and data noise interference caused by rapid jitter or high-frequency jitter is ignored, thereby improving prevention. jitter effect.

Benefits of technology

It achieves a smoother anti-shake effect, ensuring higher quality of captured videos, ignoring data noise interference caused by rapid shaking or high-frequency shaking, and significantly improving the stability of the shooting equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117750202B_ABST
    Figure CN117750202B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of image processing technology, and provides an image processing method, which is applied to a shooting device, wherein an inertial measurement unit is provided in the shooting device, and the image processing method comprises: obtaining posture data corresponding to the inertial measurement unit; storing the posture data in a first cache queue; obtaining a second cache queue based on the first cache queue, and obtaining a third cache queue corresponding to the first cache queue; updating a state at the kth sampling moment based on the second cache queue and the third cache queue; rotating an image obtained by the shooting device at the kth sampling moment based on the updated state at the kth sampling moment, thereby achieving a smoother anti-shake effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular, relates to image processing methods, devices and photographing equipment. Background Art

[0002] In recent years, with the continuous development of science and technology, various terminal devices have sprung up in people's lives, such as shooting equipment. However, the current shooting equipment still has some shortcomings that need to be solved. For example, once the shooting equipment is unstable during shooting, the overall picture (image) will shake, resulting in unclear video, that is, the quality of the captured video is poor. Therefore, the current shooting equipment generally has an anti-shake function, however, the anti-shake effect of the current shooting equipment is still poor. Summary of the invention

[0003] The embodiments of the present application provide an image processing method, apparatus, photographing device, and computer-readable storage medium, which can solve the problem of poor anti-shake effect of current photographing devices.

[0004] In a first aspect, an embodiment of the present application provides an image processing method, which is applied to a shooting device, wherein an inertial measurement unit is provided in the shooting device, and the image processing method includes:

[0005] Acquiring attitude data corresponding to the inertial measurement unit;

[0006] Storing the posture data in a first cache queue;

[0007] Acquire a second cache queue based on the first cache queue, and acquire a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, the second estimated value is a posterior estimated value of the state at the k+rth sampling moment calculated based on the posture data and the Kalman filter algorithm, and the third cache queue includes a state covariance matrix corresponding to the posture data, wherein k is a positive integer greater than or equal to 1, and r is a pre-set positive integer;

[0008] Update the state of the k-th sampling moment based on the second cache queue and the third cache queue;

[0009] The image acquired by the photographing device at the kth sampling moment is rotated based on the updated state at the kth sampling moment.

[0010] In a possible implementation manner of the first aspect, the posture data includes posture data at the k-th sampling moment, the state covariance matrix corresponding to the posture data includes the state covariance matrix at the k-th sampling moment, and if r is equal to 1, then updating the state at the k-th sampling moment based on the second cache queue and the third cache queue includes:

[0011] Calculate the state estimation error at the k+rth sampling moment based on the first estimated value and the second estimated value;

[0012] Calculate the state error parameter at the k-th sampling moment according to the state covariance matrix at the k-th sampling moment;

[0013] The state at the kth sampling moment is updated based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

[0014] In a possible implementation manner of the first aspect, it is characterized in that r is a positive integer greater than 1, the posture data includes posture data corresponding to the kth sampling moment, posture data corresponding to the intermediate moment, and posture data at the k+rth sampling moment, the intermediate moment is a sampling moment between the kth sampling moment and the k+rth sampling moment, and correspondingly, the second cache queue includes: x k+r-i+1|k+r-i 、x k+r-i|k+r-i , where 1≤i≤r, x k+r-i+1|k+r-i It is used to represent the prior estimate of the state at the k+r-i+1th sampling time estimated at the k+rith sampling time, the x k+r-1|k+r-i It is used to represent the a posteriori estimate of the state at the k+ri sampling moment calculated based on the posture data at the k+ri sampling moment and the Kalman filter algorithm at the k+ri sampling moment. The third cache queue includes P k+r-i|k+r-i , the P k+r-i|k+r-i The state covariance matrix corresponding to the k+ri th sampling moment is used to represent the state covariance matrix corresponding to the k+ri th sampling moment. Correspondingly, the state of the k th sampling moment is updated based on the second cache queue and the third cache queue, including:

[0015] Step b1, let i=1;

[0016] Step b2, updating the state at the k+rith sampling time based on the second cache queue, the third cache queue and the specified equation group;

[0017] The specified set of equations is

[0018] Step b3: if i is less than r, set i=i+1, and then return to execute step b2; if i is equal to r, output the updated state (vector) at the kth sampling moment.

[0019] In a possible implementation manner of the first aspect, the rotating the image acquired by the photographing device at the kth sampling moment based on the updated state at the kth sampling moment includes:

[0020] Calculating the interpolated attitude quaternion at the k-th sampling moment based on the updated state at the k-th sampling moment;

[0021] The image acquired by the shooting device at the kth sampling moment is rotated according to the interpolated attitude quaternion at the kth sampling moment.

[0022] In a possible implementation of the first aspect, the calculating the interpolated attitude quaternion at the kth sampling moment based on the updated state at the kth sampling moment includes:

[0023] Calculate the unit quaternion corresponding to the state at the kth sampling moment after the update;

[0024] Calculate the unit quaternion corresponding to the state at a specified adjacent time, where the specified adjacent time is a time adjacent to the kth sampling time;

[0025] The comprehensive rotation number is calculated based on the fourth relationship, which is: Among them, the Used to represent the comprehensive rotation number, the h k|k+r The unit quaternion corresponding to the state at the kth sampling moment after the update is used to represent the unit quaternion corresponding to the state at the adjacent moment includes the h k-1|k+r-1 and the h k+1|k+r+1 , the h k+1|k+r+1 It is used to represent the quaternion corresponding to the state at the k+1th sampling time after the update, and the h k-1|k+r-1 The quaternion used to represent the state corresponding to the k-1th sampling moment after the update;

[0026] The interpolated attitude quaternion at the kth sampling moment is calculated based on the comprehensive rotation number.

[0027] In a possible implementation manner of the first aspect, calculating the interpolated attitude quaternion at the kth sampling moment based on the comprehensive rotation number includes:

[0028] The interpolated attitude quaternion at the kth sampling moment is calculated based on the comprehensive rotation number and the sixth relational expression, wherein the sixth relational expression is: The h k-2|k+r-2 The quaternion used to represent the state at the k-2th sampling moment after the update, and the weight is used to represent the interpolation coefficient.

[0029] In a second aspect, an embodiment of the present application provides an image processing device, characterized in that the image processing device is applied to a shooting device, the shooting device is provided with an inertial measurement unit, and the image processing device includes:

[0030] A data acquisition unit, used to acquire attitude data corresponding to the inertial measurement unit;

[0031] A data storage unit, used for storing the posture data in a first cache queue;

[0032] A queue acquisition unit, used to acquire a second cache queue based on the first cache queue, and to acquire a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, and the second estimated value is a posteriori estimated value of the state at the k+rth sampling moment calculated based on the posture data and a Kalman filter algorithm, and the third cache queue includes a state covariance matrix corresponding to the posture data, wherein k is a positive integer greater than or equal to 1, and r is a pre-set positive integer;

[0033] An updating unit, configured to update the state of the k-th sampling moment based on the second cache queue and the third cache queue;

[0034] A rotation unit is used to rotate the image acquired by the shooting device at the kth sampling moment based on the updated state at the kth sampling moment.

[0035] In a possible implementation manner of the second aspect, the posture data includes posture data at the k-th sampling moment, and the state covariance matrix corresponding to the posture data includes the state covariance matrix at the k-th sampling moment. If r is equal to 1, the update unit, when executing the updating of the state at the k-th sampling moment based on the second cache queue and the third cache queue, is specifically used to:

[0036] Calculate the state estimation error at the k+rth sampling moment based on the first estimated value and the second estimated value;

[0037] Calculate the state error parameter at the k-th sampling moment according to the state covariance matrix at the k-th sampling moment;

[0038] The state at the kth sampling moment is updated based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

[0039] In a third aspect, an embodiment of the present application provides a shooting device, comprising an inertial measurement unit, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.

[0041] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0042] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the image processing method in the embodiments of the present application is applied to a shooting device, wherein an inertial measurement unit is provided in the shooting device, and the image processing method comprises: obtaining posture data corresponding to the inertial measurement unit; storing the posture data in a first cache queue; obtaining a second cache queue based on the first cache queue, and obtaining a third cache queue corresponding to the first cache queue, wherein the second cache queue comprises a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of the state at the estimated k+rth sampling moment, and the second estimated value is a state at the k+rth sampling moment calculated based on the posture data and a Kalman filter algorithm. a posteriori estimate, the third cache queue includes a state covariance matrix corresponding to the posture data, the k+rth sampling moment is a moment after the kth sampling moment; based on the second cache queue and the third cache queue, the state of the kth sampling moment is updated, that is, the state of the kth sampling moment can be updated with the data describing the k+rth sampling moment (reverse update); and then based on the updated state of the kth sampling moment, the image acquired by the shooting device at the kth sampling moment is rotated, that is, the hysteresis smoothing of the image can be accurately achieved, so that the shooting device can ignore the data noise interference of fast jitter or high-frequency jitter, thereby achieving a smoother anti-shake effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present application;

[0045] Figure 2 is a schematic diagram of an image processing device provided by an embodiment of the present application;

[0046] Figure 3 It is a schematic diagram of a shooting device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0050] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0053] Embodiment 1

[0054] Figure 1 The flowchart of an image processing method provided by an embodiment of the present application is shown. The image processing method is applied to a shooting device. As an example but not a limitation, the shooting device is a panoramic camera. The shooting device is provided with an inertial measurement unit. The image processing method includes: step S101, step S102, step S103, step S104 and step S105. The details are as follows:

[0055] Step S101: Acquire attitude data corresponding to the inertial measurement unit.

[0056] Wherein, the posture data corresponding to the inertial measurement unit is data used to represent the posture of the inertial measurement unit, and the posture data corresponding to the inertial measurement unit is obtained by integral calculation based on the measurement data collected by the inertial measurement unit. The posture data corresponding to the inertial measurement unit includes the posture data at the kth sampling moment, and the posture data at the kth sampling moment is obtained by integral calculation based on the measurement data collected by the inertial measurement unit at the kth sampling moment, and the sampling moment is the moment when the inertial measurement unit collects the measurement data, wherein k is a positive integer greater than or equal to 1. As an example but not limitation, the inertial measurement unit includes a gyroscope, and correspondingly, the measurement data may include angular velocity measurement data (such as three-axis angular velocity measurement values); or / and, the inertial measurement unit includes an accelerometer, and correspondingly, the accelerometer includes acceleration measurement data (three-axis acceleration measurement values).

[0057] Step S102: storing the posture data in a first cache queue.

[0058] As an example but not limitation, the length of the first cache queue is m, where m=F S / F T , the F SIt is used to represent the sampling frequency of the inertial measurement unit, F T It is used to represent the low-pass frequency threshold, and the low-pass frequency threshold is the jitter frequency threshold of the camera. T When the frequency of the shooting device is higher than F T When the frequency of the image is jittered (high-frequency motion), the measurement data of the high-frequency motion will be filtered out. The low-pass frequency threshold may be pre-stored in the shooting device, for example, F T is 1 Hz.

[0059] Step S103, obtaining a second cache queue based on the first cache queue, and obtaining a third cache queue corresponding to the first cache queue, the second cache queue including a first estimate value and a second estimate value, the first estimate value is a priori estimate value of the state at the k+rth sampling moment estimated, the second estimate value is a posteriori estimate value of the state at the k+rth sampling moment calculated based on the posture data and the Kalman filter algorithm, the third cache queue includes a state covariance matrix corresponding to the posture data, and r is a pre-set positive integer.

[0060] As an example but not a limitation, for example, assuming that r is 4 and k is 1 (ie, the kth sampling moment is the 1st sampling moment), correspondingly, the k+rth sampling moment is the 5th sampling moment. r can be used as the number of subsequent hysteresis smoothing steps.

[0061] The interval between each two adjacent moments is equal to the interval between the inertial measurement unit sampling. For example, the interval between the first sampling moment and the second sampling moment is equal to the interval between the inertial measurement unit sampling.

[0062] Step S104: updating the state of the k-th sampling moment based on the second cache queue and the third cache queue.

[0063] Optionally, the posture data includes the posture data at the kth sampling moment, and the state covariance matrix corresponding to the posture data includes the state covariance matrix at the kth sampling moment. When the kth sampling moment and the k+rth sampling moment are adjacent moments, that is, the interval duration between the kth sampling moment and the k+rth sampling moment is equal to the interval duration of the inertial measurement unit sampling, that is, r is equal to 1, the step S104 includes: step a1, step a2 and step a3.

[0064] Step a1: Calculate the state estimation error at the k+rth sampling moment based on the first estimated value and the second estimated value.

[0065] Step a2: Calculate the state error parameter at the k-th sampling moment according to the state covariance matrix at the k-th sampling moment.

[0066] Step a3: Update the state at the kth sampling moment based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

[0067] As an example but not a limitation, the first estimated value, the second estimated value, and the state estimation error at the k+rth sampling moment satisfy a first relationship: k+r_est =x k+r|k+r -x k+r|k+r-1 , when r is equal to 1, the e k+r_est The second estimated value includes the state estimation error at the k+rth sampling moment. k+r|k+r , the x k+r|k+r It is used to represent the posterior estimation value of the state at the k+rth sampling time calculated based on the posture data at the k+rth sampling time and the Kalman filter algorithm. The first estimation value includes the x k+r|k+r-1 , the x k+r|k+r-1 Used to represent the a priori estimate of the state at the k+rth sampling time estimated at the k+r-1th sampling time.

[0068] In some embodiments, the step a2 includes: calculating the state error parameter at the kth sampling moment according to the state covariance matrix at the kth sampling moment and a second relationship.

[0069] Among them, the second relationship is When r is equal to 1, the C k+r-1 Used to indicate the P k+r-1|k+r-1 The calculated state error parameter at the kth sampling moment, Pk +r-1|k+r-1 It is used to represent the state covariance matrix at the kth sampling moment, and A is used to represent a preset state transfer parameter matrix.

[0070] Optionally, step a3 includes: updating the state at the kth sampling moment based on the state estimation error at the k+rth sampling moment, the state error parameter at the kth sampling moment, and a third relationship, wherein the third relationship is x k+r-1|k+r =x k+r-1|k+r-1 +C k+r-1 e k+r_est , when r is equal to 1, the x k+r-1|k+r It is used to represent the state at the kth sampling moment after the update (the state value after hysteresis smoothing), the x k+r-1|k+r-1 Used to indicate the state at the kth sampling moment before the update.

[0071] As can be seen from the above, in this embodiment, the state estimation error at the k+rth sampling time is used to correct the state estimation at the kth sampling time, so that the state estimation at the kth sampling time changes from x to k+r-1|k+r-1 Updated to the hysteresis smoothed state x k+r-1|k+r .

[0072] Optionally, r is a positive integer greater than 1, and the posture data includes posture data corresponding to the kth sampling moment, posture data corresponding to the intermediate moment, and posture data at the k+rth sampling moment, and the intermediate moment is the sampling moment between the kth sampling moment and the k+rth sampling moment. Correspondingly, the second cache queue includes: x k+r-i+1|k+r-i 、x k+r-i|k+r-i , where 1≤i≤r, x k+r-i+1|k+r-i It is used to represent the prior estimate of the state at the k+r-i+1th sampling time estimated at the k+rith sampling time, the x k+r-i|k+r-i It is used to represent the a posteriori estimate of the state at the k+ri sampling moment calculated based on the posture data at the k+ri sampling moment and the Kalman filter algorithm at the k+ri sampling moment. The third cache queue includes P k+r-1|k+r-i , the P k+r-1|k+r-i Used to represent the state covariance matrix corresponding to the k+ri th sampling moment. Correspondingly, step S104 includes step b1, step b2 and step b3.

[0073] Step b1, let i=1;

[0074] Step b2, updating the state at the k+rith sampling time based on the second cache queue, the third cache queue and the specified equation group;

[0075] The specified set of equations is

[0076] Step b3: if i is less than r, set i=i+1, and then return to execute step b2; if i is equal to r, output the updated state (vector) at the kth sampling moment.

[0077] Among them, the updated state at the kth sampling time can be obtained by x k|k+r Indicates. k+r-i Used to indicate the P k+r-i|k+r-i The calculated state error parameter at the k+ri sampling moment, e k+r-i+1_est Used to represent the state estimation error at the k+r-i+1th sampling moment.

[0078] As an example but not a limitation, assuming that k is equal to 2 and r is equal to 3, k is equal to 2, that is, the kth sampling moment is the second sampling moment, and x can be calculated in sequence through the above steps. 4|5 、x 3|5 、x 2|5 , x 2|5 It is the status at the second sampling time after the last update.

[0079] When r is a positive integer greater than 1, the camera device does not need to estimate and correct the abnormal jitter immediately. The hysteresis processing can enable the camera device to shield most interference, thereby making the image more stable.

[0080] Step S105: rotating the image acquired by the photographing device at the kth sampling moment based on the updated state at the kth sampling moment.

[0081] Optionally, the step S105 includes: step c1 and step c2.

[0082] Step c1, calculating the interpolated attitude quaternion at the kth sampling moment based on the updated state at the kth sampling moment;

[0083] Step c2: rotating the image acquired by the shooting device at the kth sampling moment according to the interpolated attitude quaternion at the kth sampling moment.

[0084] In this way, the image after rotation processing can be made smoother.

[0085] In some embodiments, the step c1 includes: calculating the unit quaternion corresponding to the state at the kth sampling moment after the update; calculating the unit quaternion corresponding to the state at a specified adjacent moment, the specified adjacent moment being a moment adjacent to the kth sampling moment; calculating the comprehensive rotation number based on a fourth relational expression, the fourth relational expression being: Among them, the Used to represent the comprehensive rotation number, the h k|k+r The unit quaternion corresponding to the state at the kth sampling moment after the update is used to represent the unit quaternion corresponding to the state at the adjacent moment includes the h k-1|k+r-1 and the h k+1|k+r+1 , the h k+1|k+r+1 It is used to represent the quaternion corresponding to the state at the k+1th sampling time after the update, and the h k-1|k+r-1 A quaternion corresponding to the state at the k-1th sampling moment after the update is represented; and an interpolated attitude quaternion at the kth sampling moment is calculated based on the comprehensive rotation number.

[0086] For example, the calculating of the unit quaternion corresponding to the state at the kth sampling moment after the update includes: calculating the unit quaternion corresponding to the state at the kth sampling moment after the update based on the fifth relational expression, wherein the fifth relational expression is

[0087] In some embodiments, the calculating the interpolated attitude quaternion at the kth sampling moment based on the comprehensive rotation number includes: calculating the interpolated attitude quaternion at the kth sampling moment based on the comprehensive rotation number and a sixth relational expression, wherein the sixth relational expression is The h k-2|k+r-2 The quaternion used to represent the state at the k-2th sampling moment after the update, and the weight is used to represent the interpolation coefficient.

[0088] The weight may be a pre-set coefficient, for example, the weight is 0.6.

[0089] The image processing method in the embodiment of the present application is applied to a shooting device, wherein an inertial measurement unit is provided in the shooting device, and the image processing method comprises: obtaining posture data corresponding to the inertial measurement unit; storing the posture data in a first cache queue; obtaining a second cache queue based on the first cache queue, and obtaining a third cache queue corresponding to the first cache queue, wherein the second cache queue comprises a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of a state at the estimated k+rth sampling moment, and the second estimated value is a posteriori estimated value of a state at the k+rth sampling moment calculated based on the posture data and a Kalman filter algorithm, and the third cache queue comprises a first estimated value and a second estimated value. The storage queue includes a state covariance matrix corresponding to the posture data, and the k+rth sampling moment is a moment after the kth sampling moment; based on the second cache queue and the third cache queue, the state of the kth sampling moment is updated, that is, the state of the kth sampling moment can be updated with the data describing the k+rth sampling moment (reverse update); and then based on the updated state of the kth sampling moment, the image acquired by the shooting device at the kth sampling moment is rotated, that is, the hysteresis smoothing of the image can be accurately achieved, so that the shooting device can ignore the data noise interference of fast jitter or high-frequency jitter, thereby achieving a smoother anti-shake effect.

[0090] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0091] Embodiment 2

[0092] Corresponding to the image processing method described in the above embodiment, Figure 2 A schematic diagram of an image processing device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0093] The image processing device is applied to a photographing device, in which an inertial measurement unit is provided. The image processing device comprises: a data acquisition unit 201, a data storage unit 202, a queue acquisition unit 203, an update unit 204 and a rotation unit 205. Wherein:

[0094] A data acquisition unit 201 is used to acquire attitude data corresponding to the inertial measurement unit;

[0095] A data storage unit 202, used for storing the gesture data in a first cache queue;

[0096] A queue acquisition unit 203 is used to acquire a second cache queue based on the first cache queue, and to acquire a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, and the second estimated value is a posteriori estimated value of the state at the k+rth sampling moment calculated based on the posture data and a Kalman filter algorithm, and the third cache queue includes a state covariance matrix corresponding to the posture data, wherein k is a positive integer greater than or equal to 1, and r is a pre-set positive integer;

[0097] An updating unit 204, configured to update the state of the k-th sampling moment based on the second cache queue and the third cache queue;

[0098] The rotation unit 205 is used to rotate the image acquired by the shooting device at the kth sampling moment based on the updated state at the kth sampling moment.

[0099] Optionally, the posture data includes the posture data at the kth sampling moment, and the state covariance matrix corresponding to the posture data includes the state covariance matrix at the kth sampling moment. If r is equal to 1, then when the update unit executes the updating of the state at the kth sampling moment based on the second cache queue and the third cache queue, it is specifically used to: calculate the state estimation error at the k+rth sampling moment based on the first estimation value and the second estimation value; calculate the state error parameter at the kth sampling moment according to the state covariance matrix at the kth sampling moment; and update the state at the kth sampling moment based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

[0100] The image processing device in the embodiment of the present application is applied to a shooting device, wherein an inertial measurement unit is provided in the shooting device, and the image processing device can obtain posture data corresponding to the inertial measurement unit; store the posture data in a first cache queue; obtain a second cache queue based on the first cache queue, and obtain a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, and the second estimated value is a posteriori estimated value of the state at the k+rth sampling moment calculated based on the posture data and the Kalman filter algorithm, and the third cache queue The queue includes a state covariance matrix corresponding to the posture data, and the k+rth sampling moment is a moment after the kth sampling moment; based on the second cache queue and the third cache queue, the state of the kth sampling moment is updated, that is, the state of the kth sampling moment can be updated with the data describing the k+rth sampling moment (reverse update); and then based on the updated state of the kth sampling moment, the image acquired by the shooting device at the kth sampling moment is rotated, that is, the hysteresis smoothing of the image can be accurately achieved, so that the shooting device can ignore the data noise interference of fast jitter or high-frequency jitter, thereby achieving a smoother anti-shake effect.

[0101] It should be noted that for technical details not fully described in this embodiment, reference may be made to the image processing methods provided in the various embodiments in the above-mentioned embodiment 1.

[0102] Embodiment 3

[0103] The shooting device 3 in this embodiment includes: an inertial measurement unit 30, at least one processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the at least one processor 31. When the processor 31 executes the computer program 33, the steps in any of the above-mentioned image processing method embodiments are implemented.

[0104] When the processor 31 executes the computer program 33, the steps in the above-mentioned various image processing method embodiments are implemented, for example: Figure 1 Alternatively, when the processor 31 executes the computer program 33, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 2 Functions of the illustrated units 201 to 205. As an example but not a limitation, the photographing device 3 may be a panoramic camera.

[0105] Those skilled in the art will understand that this embodiment is merely an example of the shooting device 3 and does not constitute a limitation on the shooting device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.

[0106] The processor 31 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, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0107] In some embodiments, the memory 32 may be an internal storage unit of the photographing device 3, such as a hard disk or memory of the photographing device 3. In other embodiments, the memory 32 may also be an external storage device of the photographing device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the photographing device 3. Further, the memory 32 may also include both an internal storage unit of the photographing device 3 and an external storage device. The memory 32 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program 33. The memory 32 may also be used to temporarily store data that has been output or is to be output.

[0108] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0109] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0110] The embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program 33. When the computer program 33 is executed by the processor 31, the steps in the above-mentioned method embodiments can be implemented.

[0111] The embodiment of the present application provides a computer program 33 product. When the computer program 33 product runs on the shooting device 3, the shooting device 3 can implement the steps in the above-mentioned method embodiments when executing.

[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 33. The computer program 33 can be stored in a computer-readable storage medium. When the computer program 33 is executed by the processor 31, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program 33 includes a computer program 33 code, and the computer program 33 code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying the computer program 33 code to the shooting device 3, a recording medium, a computer memory 32, a read-only memory 32 (ROM, Read-Only Memory), a random access memory 32 (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0113] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0114] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0115] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An image processing method, characterized in that: The image processing method is applied to a photographing device, wherein an inertial measurement unit is provided in the photographing device, and the image processing method comprises: Acquiring attitude data corresponding to the inertial measurement unit; Storing the posture data in a first cache queue; Acquire a second cache queue based on the first cache queue, and acquire a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, the second estimated value is a posterior estimated value of the state at the k+rth sampling moment calculated based on the posture data and the Kalman filter algorithm, and the third cache queue includes a state covariance matrix corresponding to the posture data, wherein k is a positive integer greater than or equal to 1, and r is a pre-set positive integer; Update the state of the k-th sampling moment based on the second cache queue and the third cache queue; Rotating the image acquired by the photographing device at the kth sampling moment based on the updated state at the kth sampling moment; Among them, the rotating processing of the image acquired by the shooting device at the kth sampling moment based on the state at the kth sampling moment after the update includes: calculating the interpolation posture quaternion of the kth sampling moment based on the state at the kth sampling moment after the update, and rotating the image acquired by the shooting device at the kth sampling moment according to the interpolation posture quaternion at the kth sampling moment.

2. The image processing method according to claim 1, characterized in that: The posture data includes the posture data at the k-th sampling moment, the state covariance matrix corresponding to the posture data includes the state covariance matrix at the k-th sampling moment, and if r is equal to 1, then updating the state at the k-th sampling moment based on the second cache queue and the third cache queue includes: Calculate the state estimation error at the k+rth sampling moment based on the first estimated value and the second estimated value; Calculate the state error parameter at the k-th sampling moment according to the state covariance matrix at the k-th sampling moment; The state at the kth sampling moment is updated based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

3. The image processing method according to claim 1, characterized in that: r is a positive integer greater than 1, the posture data includes posture data corresponding to the kth sampling moment, posture data corresponding to the intermediate moment, and posture data at the k+rth sampling moment, the intermediate moment is the sampling moment between the kth sampling moment and the k+rth sampling moment, and correspondingly, the second cache queue includes: x k+r-i+1|k+r-i 、x k+r-i|k+r-i , where 1≤i≤r, x k+r-i+1|k+r-i It is used to represent the prior estimate of the state at the k+r-i+1th sampling time estimated at the k+rith sampling time, the x k+r-i|k+r-i It is used to represent the a posteriori estimate of the state at the k+ri sampling moment calculated based on the posture data at the k+ri sampling moment and the Kalman filter algorithm at the k+ri sampling moment. The third cache queue includes P k+r-i|k+r-i , the P k+r-i|k+r-i The state covariance matrix corresponding to the k+ri th sampling moment is used to represent the state covariance matrix corresponding to the k+ri th sampling moment. Correspondingly, the state of the k th sampling moment is updated based on the second cache queue and the third cache queue, including: Step b1, let i=1; Step b2, updating the state at the k+rith sampling time based on the second cache queue, the third cache queue and the specified equation group; The specified set of equations is Step b3: if i is less than r, set i=i+1, and then return to execute step b2; if i is equal to r, output the updated state (vector) at the kth sampling moment.

4. The image processing method according to claim 1, wherein: The interpolation attitude quaternion calculated at the kth sampling moment based on the updated state at the kth sampling moment includes: Calculate the unit quaternion corresponding to the state at the kth sampling moment after the update; Calculate the unit quaternion corresponding to the state at a specified adjacent time, where the specified adjacent time is a time adjacent to the kth sampling time; The comprehensive rotation number is calculated based on the fourth relationship, which is: Among them, the Used to represent the comprehensive rotation number, the h k|k+r The unit quaternion corresponding to the state at the kth sampling moment after the update is used to represent the unit quaternion corresponding to the state at the adjacent moment includes the h k-1|k+r-1 and the h k+1|k+r+1 , the h k+1|k+r+1 It is used to represent the quaternion corresponding to the state at the k+1th sampling time after the update, and the h k-1|k+r-1 The quaternion used to represent the state corresponding to the k-1th sampling moment after the update; The interpolated attitude quaternion at the kth sampling moment is calculated based on the comprehensive rotation number.

5. The image processing method according to claim 4, characterized in that: The interpolation attitude quaternion calculated at the kth sampling moment based on the comprehensive rotation number includes: The interpolated attitude quaternion at the kth sampling moment is calculated based on the comprehensive rotation number and the sixth relational expression, wherein the sixth relational expression is: The h k-2|k+r-2 The quaternion used to represent the state at the k-2th sampling moment after the update, and the weight is used to represent the interpolation coefficient.

6. An image processing device, characterized in that: The image processing device is applied to a photographing device, wherein an inertial measurement unit is provided in the photographing device, and the image processing device comprises: A data acquisition unit, used to acquire attitude data corresponding to the inertial measurement unit; A data storage unit, used for storing the posture data in a first cache queue; A queue acquisition unit, used to acquire a second cache queue based on the first cache queue, and to acquire a third cache queue corresponding to the first cache queue, wherein the second cache queue includes a first estimated value and a second estimated value, wherein the first estimated value is a priori estimated value of the state at the k+rth sampling moment estimated, and the second estimated value is a posteriori estimated value of the state at the k+rth sampling moment calculated based on the posture data and a Kalman filter algorithm, and the third cache queue includes a state covariance matrix corresponding to the posture data, wherein k is a positive integer greater than or equal to 1, and r is a pre-set positive integer; An updating unit, configured to update the state of the k-th sampling moment based on the second cache queue and the third cache queue; a rotation unit, configured to rotate the image acquired by the photographing device at the kth sampling moment based on the updated state at the kth sampling moment; When the rotation unit executes the rotation processing of the image acquired by the shooting device at the kth sampling moment based on the state at the kth sampling moment after the update, it is specifically used to: calculate the interpolation posture quaternion at the kth sampling moment based on the state at the kth sampling moment after the update, and rotate the image acquired by the shooting device at the kth sampling moment according to the interpolation posture quaternion at the kth sampling moment.

7. The image processing device according to claim 6, wherein: The posture data includes the posture data at the k-th sampling moment, the state covariance matrix corresponding to the posture data includes the state covariance matrix at the k-th sampling moment, and if r is equal to 1, the updating unit, when executing the updating of the state at the k-th sampling moment based on the second cache queue and the third cache queue, is specifically used to: Calculate the state estimation error at the k+rth sampling moment based on the first estimated value and the second estimated value; Calculate the state error parameter at the k-th sampling moment according to the state covariance matrix at the k-th sampling moment; The state at the kth sampling moment is updated based on the state estimation error at the k+rth sampling moment and the state error parameter at the kth sampling moment.

8. A photographing device, comprising an inertial measurement unit, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.