Video image stabilization method, device and equipment suitable for motorcycle driving recorder

By synchronizing the camera and inertial sensor data, estimating and smoothing the quaternion of the camera movement, and calculating the rotation matrix to compensate the video frame, the problem of video jitter caused by vibration and bumps in the motorcycle driving recorder is solved, and efficient and stable video stabilization is achieved. like effect.

CN118803420APending Publication Date: 2024-10-18ZHEJIANG UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411010119.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Motorcycle driving recorders are easily affected by vibrations and bumps when driving at high speeds and on rough roads, resulting in video blur and jitter. There is a lack of low-cost, small-sized, and foreground-free video stabilization solutions suitable for motorcycle driving recorders.

Method used

By synchronizing the sampling of camera images and inertial sensor data, the quaternion of the camera movement is estimated, and the velocity damping bidirectional SLERP smoothing technology is used to smooth the motion of the quaternion, and the rotation matrix is ​​calculated to compensate the video frame to achieve video stabilization.

Benefits of technology

It achieves efficient and stable video stabilization, provides a low-cost, foreground-free video stabilization solution for motorcycle driving recorders, and improves video quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803420A_ABST
    Figure CN118803420A_ABST
Patent Text Reader

Abstract

The invention discloses a video image stabilization method, device and equipment suitable for a motorcycle driving recorder. The method comprises the following steps: acquiring image data of a camera on a motorcycle and six-axis data, synchronous image data and sampling time of inertial sensor data of an inertial sensor; estimating an orientation quaternion of the movement of the camera by using the angular velocity and acceleration data; based on velocity damping bidirectional SLERP smoothing, the orientation quaternion obtained through motion estimation is smoothed; and obtaining a rotation matrix through operation by using the quaternion before and after smoothing, and compensating the video frame by using the rotation matrix to obtain the video frame after image stabilization. Through application of the method, efficient and stable video image stabilization is realized, and a video image stabilization scheme which is low in cost and is not influenced by a foreground is provided for equipment such as a motorcycle driving recorder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video processing, and in particular to a video stabilization method, device and equipment suitable for a motorcycle driving recorder. Background Art

[0002] In recent years, with the vigorous development of the motorcycle industry, motorcycle dashcams have been rapidly updated. When driving at high speeds and on rough roads, motorcycles are susceptible to severe vibrations and bumps. These factors can cause the video captured by the dashcam to appear blurry and jittery, seriously affecting the video quality. These videos are not only crucial in accident evidence collection and ensuring riding safety, but also have important value in recording riding experiences and sharing travel clips. Video stabilization technology can effectively reduce video blur caused by vibration, making the video more stable and clear. Therefore, with the continuous development of the motorcycle industry, the application of video stabilization technology in dashcams will become increasingly important.

[0003] At present, video stabilization technology is mostly used in mobile phones, handheld cameras, and sports cameras, and there are few video stabilization solutions suitable for motorcycle dashcams. Mechanical stabilization compensates for camera shake through motion-sensitive elements and servo control systems, but it is usually bulky and not suitable for motorcycle dashcam scenarios; optical stabilization compensates for pixel shift caused by shake through the translation of optical components, but it is also not suitable for motorcycle dashcam scenarios due to the high cost of optical components; electronic stabilization based on image processing, although low-cost and small in size, but the algorithm is greatly affected by the image scene and is only suitable for some motorcycle dashcam scenarios.

[0004] Therefore, there is currently a lack of a low-cost, small-sized, foreground-insensitive video stabilization solution suitable for motorcycle dashcams to eliminate jitters caused by road bumps, sudden speed changes, vehicle shaking, etc. Inertial sensors that conform to the trend of the times have the characteristics of miniaturization, low power consumption, and can obtain the current posture information of moving objects without considering scene information. They can be used to accurately estimate motion vectors and improve the execution speed of the stabilization system, which is very suitable for motorcycle dashcam video stabilization scenarios. Summary of the invention

[0005] The present invention aims to overcome the problem of video jitter in a driving recorder due to various external reasons during the driving of a motorcycle, and provides a video stabilization method, device and equipment suitable for a motorcycle driving recorder. The present invention estimates and smoothes the data obtained from the inertial sensor, and compensates the video frame, thereby achieving efficient and stable video stabilization, and providing a better video stabilization method for motorcycle driving recorders and other equipment.

[0006] A first aspect of the present invention provides a method for stabilizing video of a motorcycle driving recorder, comprising:

[0007] Step 1) synchronizing the sampling time of the camera image and the inertial sensor data; the inertial sensor data includes angular velocity and acceleration data;

[0008] Step 2) using the angular velocity and acceleration data to estimate the camera motion orientation quaternion;

[0009] Step 3) using velocity damped bidirectional SLERP smoothing to perform motion smoothing on the estimated orientation quaternion;

[0010] Step 4) The quaternions before and after smoothing are used to obtain a rotation matrix, and the rotation matrix is ​​used to compensate the video frame to obtain a stabilized video.

[0011] Wherein, the sampling time of the synchronous camera image and the inertial sensor data in step 1) includes:

[0012] The minimum alignment period is calculated according to the camera sampling period and the inertial sensor sampling period, and this period is used as the sampling period of the camera data.

[0013] Wherein, the step 2) of estimating the quaternion of the camera's direction of motion using the angular velocity and acceleration data includes:

[0014] 2.1) Obtain the gyroscope orientation quaternion based on the strapdown integration of the gyroscope data;

[0015] 2.2) Obtaining accelerometer correction quaternion based on accelerometer data;

[0016] 2.3) Calculate the gyroscope orientation quaternion and the accelerometer correction quaternion to obtain the predicted camera motion orientation quaternion in the near inertial system;

[0017] 2.4) Estimate the zero bias value through the inconsistency between the gyroscope strapdown integration and the accelerometer measurement during the motion, and subtract this value from the raw gyroscope measurement data before the gyroscope strapdown integration;

[0018] Repeat the above steps to get a more reliable camera motion orientation quaternion.

[0019] Wherein, the step 3) uses velocity damped bidirectional SLERP smoothing to perform motion smoothing on the estimated orientation quaternion, including:

[0020] 3.1) According to the IMU sampling frequency and the set smoothness σ, the maximum smoothness σ max , maximum smoothness σ at high speed v_max Calculate the corresponding smoothness ratio coefficient α, the maximum smoothness ratio coefficient α max And the maximum smoothness ratio coefficient α at high speed v_max .

[0021] 3.2) Calculate the angle based on the adjacent quaternions and get the angular velocity based on the IMU sampling frequency;

[0022] 3.3) Perform a forward exponential filter on the angular velocity, with a maximum smoothness coefficient α v_max As the filter coefficient, the forward smoothed angular velocity is obtained; then the forward smoothed angular velocity is subjected to an inverse exponential filter to offset the delay introduced by the forward exponential filter, and the smoothed angular velocity is obtained;

[0023] 3.4) Calculate the maximum angular velocity, normalize the angular velocity, and use the normalized angular velocity and the maximum smoothness coefficient α max And the maximum smoothness ratio coefficient α at high speed v_max Calculate the proportionality factor α v ;

[0024] 3.5) Perform forward SLERP linear interpolation on the quaternion, and use α as the smoothing coefficient v A forward-smoothed quaternion sequence is obtained; a reverse SLERP linear interpolation is then performed on the forward-smoothed quaternion sequence to offset the delay introduced by the forward SLERP linear interpolation, and a first-order smoothed quaternion sequence is obtained;

[0025] 3.6) Calculate the angle based on the rotation difference of the quaternion before and after smoothing, update the maximum angle, and normalize the angle;

[0026] 3.7) Perform a forward exponential filter on the angle, with a maximum smoothness coefficient α v_max As the filter coefficient, the forward smoothed angle is obtained; then the forward smoothed angle is subjected to an inverse exponential filter to offset the delay introduced by the forward exponential filter, and the smoothed angle is obtained;

[0027] 3.8) Normalize the smoothed angle again so that the angle is between [0.5, 1.0];

[0028] 3.9) According to the maximum smoothness proportional coefficient α max 、Maximum smoothness ratio coefficient α at high speed v_max , angular velocity, angle to calculate the proportional coefficient α dis ;

[0029] 3.10) Perform forward SLERP linear interpolation on the first-order smoothed quaternion sequence, and use α as the smoothing coefficient dis A forward-smoothed quaternion sequence is obtained; a reverse SLERP linear interpolation is performed on the forward-smoothed quaternion sequence to offset the delay introduced by the forward SLERP linear interpolation, and a second-order smoothed quaternion sequence is obtained.

[0030] The step 4) uses the quaternions before and after smoothing to obtain a rotation matrix, and uses the rotation matrix to compensate the video frame to obtain a stabilized video, including:

[0031] The quaternion difference between the adjacent quaternions in the quaternion sequence obtained by second-order smoothing is calculated, converted into a rotation matrix, and the pixels in the video frame are compensated to obtain a stabilized video frame.

[0032] A second aspect of the present invention provides a device for stabilizing video of a motorcycle driving recorder, comprising:

[0033] Data synchronization acquisition module: synchronizes the sampling period of image data and inertial sensor data and samples the data. The inertial sensor data includes gyroscope data and acceleration data.

[0034] Motion estimation module: uses angular velocity and acceleration data to estimate the quaternion of the camera's direction;

[0035] Motion smoothing module: Use velocity-damped SLERP linear interpolation to smooth the orientation quaternion of video frames;

[0036] Motion compensation module: The rotation difference calculated by the quaternion before and after smoothing is converted into a rotation matrix to compensate the video frame to obtain a stable video frame.

[0037] The third aspect of the present invention provides a device suitable for video stabilization of a motorcycle driving recorder, including a communication interface, a processor, an input device, a camera, an inertial sensor, a memory, and a computer program. The processor runs the program in the memory to implement the above-mentioned video stabilization method.

[0038] The present invention provides a video stabilization method, device and equipment suitable for a motorcycle driving recorder. By synchronizing the sampling time of the camera image and the inertial sensor data, image data and inertial sensor data with time stamp alignment are obtained; the inertial sensor data includes angular velocity and acceleration data; the angular velocity and acceleration data are used to estimate the quaternion of the camera movement; the velocity damped bidirectional SLERP smoothing is used to perform motion smoothing on the estimated quaternion of the direction; the quaternions before and after smoothing are used to calculate the rotation matrix, and the rotation matrix is ​​used to compensate the video frame to obtain the stabilized video. Through the application of the above method, efficient and stable video stabilization is achieved, and an excellent video stabilization method is provided for equipment such as motorcycle driving recorders.

[0039] The invention has the advantages of realizing efficient and stable video stabilization and providing a low-cost video stabilization solution that is not affected by the foreground for equipment such as motorcycle driving recorders. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to illustrate the technical solution of the present invention in more detail, the drawings required for describing the implementation scheme will be briefly introduced below. Obviously, the drawings described below are some implementation schemes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a schematic flow diagram of the method of the present invention;

[0042] Figure 2 It is a schematic diagram of the process of the device of the present invention;

[0043] Figure 3 It is a structural schematic diagram of the device of the present invention. DETAILED DESCRIPTION

[0044] The present invention will be described more comprehensively and clearly below in conjunction with the accompanying drawings. However, it should be understood by those skilled in the art that these examples are only used to illustrate the present invention and should not be construed as limiting the present invention. All other examples obtained without departing from the spirit and scope of the present invention belong to the protection scope of the present invention.

[0045] Example 1

[0046] like Figure 1 As shown, this embodiment provides a video stabilization method applicable to a motorcycle driving recorder, and the steps are as follows:

[0047] Step 1) Synchronize the sampling period of image data and inertial sensor data and sample the data; the inertial sensor data includes gyroscope data and acceleration data.

[0048] The specific steps of step 1) are as follows:

[0049] Step 1.1) Get the sampling period t of IMU imu and the camera sampling period t cam (t cam Much larger than t imu ).

[0050] Step 1.2) Calculate (n-1)t imu <t cam <=nt imu The value of n when the condition is met is:

[0051] Δt=nt imu -t cam (1)

[0052] Where Δt is the difference required to align the IMU and camera sampling times.

[0053] Step 1.3) Get the new camera sampling period:

[0054] t cam_new =t cam +Δt (2)

[0055] At this point, step 1 is completed, and the sampling time of the camera image and the inertial sensor data is synchronized, and the image data and the inertial sensor data are obtained at this sampling time.

[0056] Step 2) Use the angular velocity and acceleration data to estimate the quaternion of the camera's direction of motion.

[0057] The specific steps of step 2) are as follows:

[0058] Step 2.1) Estimate the orientation quaternion based on the gyroscope angular velocity data. The calculation formula is as follows:

[0059]

[0060] Where G represents the gyroscope coordinate system, and H represents the auxiliary coordinate system, which is used to represent the orientation quaternion obtained by the pure gyroscope integral and the gyroscope zero bias integral drift. Indicates t k The quaternion that rotates from the gyroscope coordinate system to the auxiliary coordinate system at any moment; Represents quaternion multiplication; Indicates that ω is the rotation axis and T s ω is the quaternion obtained by the rotation angle; the initial orientation quaternion is

[1000] T , with the real part first. The previous gyroscope estimated orientation quaternion multiplied by the quaternion obtained by the gyroscope rotation gives t k The gyroscope angular velocity data at the time is used to estimate the orientation quaternion.

[0061] Step 2.2) Due to gyroscope zero bias, noise, measurement error and other reasons, the orientation quaternion estimated by the gyroscope may be inaccurate. To solve this problem, acceleration information is introduced to calculate the accelerometer correction quaternion.

[0062] Specifically, the gyroscope angular velocity data is used to estimate the orientation quaternion Convert acceleration data to auxiliary coordinate system Use a low-pass filter to filter the acceleration data so that similar acceleration and deceleration cancel each other out and obtain the filtered acceleration. Correct the quaternion using the accelerometer at the previous moment Convert the acceleration of the auxiliary coordinate system to the global coordinate system (a lp ) ε; Take the angle between the acceleration vector and the gravity vector as the rotation angle, take the cross product of the acceleration vector and the gravity vector as the rotation axis, convert the quaternion in axis-angle form to obtain the calibration quaternion, which is used to calibrate the current accelerometer correction quaternion.

[0063]

[0064] where q cali Represents the calibration quaternion, the acceleration data is [a x a y a z ] T .

[0065] Step 2.3) Calculate the IMU orientation quaternion based on the results obtained in the above two steps. The calculation formula is as follows:

[0066]

[0067] The orientation quaternion sequence obtained at this time has too much noise. In order to improve the system stability and response speed and reduce oscillation, the orientation quaternion sequence needs to be smoothed.

[0068] Step 3) Use velocity-damped bidirectional SLERP smoothing to perform motion smoothing on the estimated orientation quaternion.

[0069] The specific steps of step 3) are as follows:

[0070] Step 3.1) Set the smoothness σ, the maximum smoothness σ max , maximum smoothness σ at high speed v_max and the maximum angular velocity ω max .

[0071] Step 3.2) Calculate the proportional coefficient corresponding to the smoothness. The calculation formula is as follows:

[0072] α=1-e -(1 / sample_rate) / σ (7)

[0073] Where sample_rate is the sampling frequency of IMU, and the smoothness proportional coefficient α is obtained, and the maximum smoothness proportional coefficient α max And the maximum smoothness ratio coefficient α at high speed v_max .

[0074] Step 3.3) Calculate the first-order smoothing according to the speed. The specific steps are as follows:

[0075] Step 3.3.1) Calculate the rotation difference between adjacent quaternions:

[0076]

[0077] in is the inverse of the previous direction quaternion, q is the current direction quaternion, and the two are multiplied to obtain the quaternion rotation difference.

[0078] Step 3.3.2) Convert the orientation quaternion into Euler angles and calculate the angular velocity:

[0079]

[0080] ω=θ dist *sample_rate*(180 / π) (10)

[0081] Where sample_rate is the sampling frequency of the IMU, and the angular velocity (degrees / second) sequence is calculated.

[0082] Since the vibration generated during the driving of the motorcycle is mainly in the pitch direction, the angles involved in the following angular velocity and angle are all pitch angles.

[0083] Step 3.3.3) To obtain a stable angular velocity sequence, perform exponential filtering on the angular velocity:

[0084]

[0085] Similarly, the angular velocity after the forward exponential filtering is subjected to a reverse exponential filtering to offset the delay introduced by the forward exponential filtering and obtain the angular velocity after the exponential filtering:

[0086]

[0087] Step 3.3.4) Normalize the angular velocity obtained after exponential filtering to obtain the proportional coefficient required for SLERP spherical linear interpolation.

[0088] Calculate the maximum angular velocity for normalization:

[0089] ω max_2 =ω max *σ*0.5 (13)

[0090] Normalize the angular velocity to get the normalized angular velocity sequence:

[0091] ω out_norm =ω out2 / ω max_2 (14)

[0092] The angular velocity interpolation coefficient α is calculated based on the normalized angular velocity v , whose value range is [0,1]:

[0093] α v =min(α max *(1-ωout_norm_t )+α v_max *ω out_norm_t ,1) (15)

[0094] Step 3.3.5) Interpolate the proportional coefficient α based on the obtained angular velocity v , using SLERP spherical linear interpolation to smooth the orientation of the quaternion.

[0095] Perform a forward SLERP spherical linear interpolation on the orientation quaternion sequence:

[0096]

[0097] Similarly, a reverse SLERP spherical linear interpolation is performed on the orientation quaternion after the forward SLERP spherical linear interpolation to offset the delay introduced by the forward SLERP spherical linear interpolation:

[0098]

[0099] Get the first-order smoothed orientation quaternion sequence.

[0100] Step 3.4) Calculate the second-order smoothing based on the distance. The specific steps are as follows:

[0101] Step 3.4.1) Traverse the quaternion rotation angle sequence θ dist , get the maximum distance value θ dist_max , normalize the angle according to the maximum distance value.

[0102] θ dist_norm =θ dist / θ dist_max (18)

[0103] Discard the data with a distance value less than 0.5 and set θ dist_norm Values ​​less than 0.5 are assigned 0.

[0104] Step 3.4.2) To obtain a stable angle sequence, perform exponential filtering on the normalized angles:

[0105]

[0106] Similarly, the angle after the forward exponential filtering is subjected to a reverse exponential filtering to offset the delay introduced by the forward exponential filtering:

[0107]

[0108] Step 3.4.3) Normalize the angular velocity obtained after exponential filtering to obtain the proportional coefficient required for SLERP spherical linear interpolation.

[0109] The quaternion rotation angle sequence θ after traversal index filteringout2 , get the maximum distance value θ out2_max , normalize the angle according to the maximum distance value:

[0110] θ out2_norm =θ out2 / θ out2_max (twenty one)

[0111] Control the angle between 0.5 and 1.0:

[0112] θ out2_norm2 =(θ out2_norm +1) / 2 (22)

[0113] The distance interpolation proportional coefficient α is calculated based on the smoothing proportional coefficient, angular velocity, and angle dis :

[0114] α dis =α max (1-ω out_norm_t θ out2_norm2_t )+α v_max ω out_norm_t θ out2_norm2_t (twenty three)

[0115] Step 3.4.4) Interpolate the proportional coefficient α according to the obtained distance dis , using SLERP spherical linear interpolation to smooth the orientation of the quaternion.

[0116] Perform a forward SLERP spherical linear interpolation on the first-order smoothed orientation quaternion sequence:

[0117]

[0118] Similarly, a reverse SLERP spherical linear interpolation is performed on the orientation quaternion after the forward SLERP spherical linear interpolation to offset the delay introduced by the forward SLERP spherical linear interpolation:

[0119]

[0120] Get the second-order smoothed orientation quaternion sequence.

[0121] The orientation quaternion sequence obtained at this time can be used to compensate the video frames.

[0122] Step 4) The quaternions before and after smoothing are used to obtain a rotation matrix, and the rotation matrix is ​​used to compensate the video frame to obtain a stabilized video.

[0123] The specific steps of step 4) are as follows:

[0124] The rotation difference is obtained by multiplying the inverse of the smoothed quaternion and the quaternion before smoothing, that is, Convert to rotation matrix R dist The rotation matrix is ​​used to rotate the pixels in the compensated video frame to obtain a stable video frame without jitter components. The corresponding rotation matrix is ​​used to compensate the corresponding video frame to obtain a motion compensated video.

[0125] In summary, the present invention provides a video stabilization method suitable for a motorcycle driving recorder, which uses angular velocity and acceleration data to estimate the accurate orientation quaternion of the camera movement, and based on this orientation quaternion, velocity-damped SLERP spherical linear interpolation is used to obtain a smoothed orientation quaternion sequence, and the rotation difference quaternion is calculated based on the quaternions before and after smoothing, and then the rotation difference quaternion is converted into a rotation matrix to compensate the pixels in the video frame to obtain a stabilized video frame.

[0126] Example 2

[0127] like Figure 2 As shown, this embodiment provides a video stabilization device suitable for a motorcycle driving recorder, including a data synchronization acquisition module 21, a motion estimation module 22, a motion smoothing module 23, and a motion compensation module 24.

[0128] 21 Data synchronization acquisition module: used to synchronize the sampling period of image data and inertial sensor data and sample data. The inertial sensor data includes gyroscope data and acceleration data.

[0129] 22 Motion estimation module: uses angular velocity and acceleration data to estimate the quaternion of the camera's motion direction;

[0130] 23 Motion smoothing module: Use velocity damped SLERP linear interpolation to smooth the orientation quaternion of the video frame;

[0131] 24 Motion compensation module: The rotation difference calculated by the quaternion before and after smoothing is converted into a rotation matrix to compensate the video frame to obtain the stabilized video frame.

[0132] A video stabilization device applicable to a motorcycle driving recorder in this embodiment is used to implement a video stabilization method applicable to a motorcycle driving recorder in embodiment 1.

[0133] Example 3

[0134] like Figure 3 As shown, this embodiment provides a video stabilization device 30 suitable for a motorcycle driving recorder, including a communication interface 31, a processor 32, an input device 33, a camera 331, an inertial sensor 332, a memory 34, and a computer program 341. The processor 32 runs the computer program 341 in the memory 34 to implement the above-mentioned video stabilization method, which includes:

[0135] The image data and inertial sensor data sampling periods are synchronized and the data is sampled, where the inertial sensor data includes gyroscope data and acceleration data.

[0136] The angular velocity and acceleration data are used to estimate the quaternion of the camera's direction.

[0137] Smooth the orientation quaternion of video frames using velocity-damped SLERP linear interpolation.

[0138] The rotation difference calculated by the quaternion before and after smoothing is converted into a rotation matrix, and the video frame is compensated to obtain the stabilized video frame.

[0139] In addition, the present invention also provides a computer software product, the computer software product includes a computer program, the program is stored in a memory, and when executed by a processor, it can implement the video stabilization method for a motorcycle driving recorder described above, the method comprising:

[0140] The image data and inertial sensor data sampling periods are synchronized and the data is sampled, where the inertial sensor data includes gyroscope data and acceleration data.

[0141] The angular velocity and acceleration data are used to estimate the quaternion of the camera's direction.

[0142] Smooth the orientation quaternion of video frames using velocity-damped SLERP linear interpolation.

[0143] The rotation difference calculated by the quaternion before and after smoothing is converted into a rotation matrix, and the video frame is compensated to obtain the stabilized video frame.

[0144] Through the detailed description of the above examples, those skilled in the art should clearly understand that the above implementation method can be implemented by software plus hardware platform. The above implementation scheme can be stored in a computer-readable storage medium in the form of software, such as a disk, CD / DVD, USB flash memory, solid-state hard disk, etc., and the software product can be run by computer instructions to implement the method described in the example or part of the example.

[0145] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present invention, rather than to restrict it. Although the above examples have described the present invention in detail, ordinary technicians in this field should still understand that they can still modify the technical solutions described in the above examples, or make equivalent replacements for some of the technical features therein. These modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the exemplary technical solutions of the present invention.

Claims

1. A video stabilization method suitable for a motorcycle driving recorder, characterized in that: include: Step 1) synchronizing the sampling time of the camera image and the inertial sensor data; the inertial sensor data includes angular velocity and acceleration data; Step 2) using the angular velocity and acceleration data to estimate the camera motion orientation quaternion; Step 3) using velocity damped bidirectional SLERP smoothing to perform motion smoothing on the estimated orientation quaternion; Step 4) The quaternions before and after smoothing are used to obtain a rotation matrix, and the rotation matrix is ​​used to compensate the video frame to obtain a stabilized video.

2. The video stabilization method for a motorcycle driving recorder according to claim 1, characterized in that: The sampling time of the synchronous camera image and the inertial sensor data described in step 1) includes: The minimum alignment period is calculated according to the camera sampling period and the inertial sensor sampling period, and this period is used as the sampling period of the camera data.

3. The video stabilization method for a motorcycle driving recorder according to claim 1, characterized in that: Step 2) of estimating the camera motion orientation quaternion using angular velocity and acceleration data includes: 2.1) Obtain the gyroscope orientation quaternion based on the strapdown integration of the gyroscope data; 2.2) Obtaining accelerometer correction quaternion based on accelerometer data; 2.3) Calculate the gyroscope orientation quaternion and the accelerometer correction quaternion to obtain the predicted camera motion orientation quaternion in the near inertial system; 2.4) Estimate the zero bias value through the inconsistency between the gyroscope strapdown integration and the accelerometer measurement during the motion, and subtract this value from the raw gyroscope measurement data before the gyroscope strapdown integration; Repeat the above steps to get a more reliable camera motion orientation quaternion.

4. The video stabilization method for a motorcycle driving recorder according to claim 1, characterized in that: The step 3) of using velocity damped bidirectional SLERP smoothing to perform motion smoothing on the estimated orientation quaternion includes: 3.1) According to the IMU sampling frequency and the set smoothness σ, the maximum smoothness σ max , maximum smoothness σ at high speed v_max Calculate the corresponding smoothness ratio coefficient α, the maximum smoothness ratio coefficient α max And the maximum smoothness ratio coefficient α at high speed v_max ; 3.2) Calculate the angle based on the adjacent quaternions and get the angular velocity based on the IMU sampling frequency; 3.3) Perform a forward exponential filter on the angular velocity, with a maximum smoothness coefficient α v_max As the filter coefficient, the forward smoothed angular velocity is obtained; then the forward smoothed angular velocity is subjected to an inverse exponential filter to offset the delay introduced by the forward exponential filter, and the smoothed angular velocity is obtained; 3.4) Calculate the maximum angular velocity, normalize the angular velocity, and use the normalized angular velocity and the maximum smoothness coefficient α max And the maximum smoothness ratio coefficient α at high speed v_max Calculate the proportionality factor α v ; 3.5) Perform forward SLERP linear interpolation on the quaternion, and use α as the smoothing coefficient v A forward-smoothed quaternion sequence is obtained; a reverse SLERP linear interpolation is then performed on the forward-smoothed quaternion sequence to offset the delay introduced by the forward SLERP linear interpolation, and a first-order smoothed quaternion sequence is obtained; 3.6) Calculate the angle based on the rotation difference of the quaternion before and after smoothing, update the maximum angle, and normalize the angle; 3.7) Perform a forward exponential filter on the angle, with a maximum smoothness coefficient α v_max As the filter coefficient, the forward smoothed angle is obtained; then the forward smoothed angle is subjected to an inverse exponential filter to offset the delay introduced by the forward exponential filter, and the smoothed angle is obtained; 3.8) Normalize the smoothed angle again so that the angle is between [0.5, 1.0]; 3.9) According to the maximum smoothness proportional coefficient α max 、Maximum smoothness ratio coefficient α at high speed v_max , angular velocity, angle calculation to get the proportional coefficient α dis ; 3.10) Perform forward SLERP linear interpolation on the first-order smoothed quaternion sequence, and use α as the smoothing coefficient dis A forward-smoothed quaternion sequence is obtained; a reverse SLERP linear interpolation is performed on the forward-smoothed quaternion sequence to offset the delay introduced by the forward SLERP linear interpolation, and a second-order smoothed quaternion sequence is obtained.

5. The video stabilization method for a motorcycle driving recorder according to claim 1, characterized in that: The method of step 4) using the quaternions before and after smoothing to obtain a rotation matrix, and using the rotation matrix to compensate the video frame to obtain a stabilized video includes: The quaternion difference between the adjacent quaternions in the quaternion sequence obtained by second-order smoothing is calculated, converted into a rotation matrix, and the pixels in the video frame are compensated to obtain a stabilized video frame.

6. A video stabilization device suitable for a motorcycle driving recorder, comprising: Data synchronization acquisition module: synchronizes the sampling period of image data and inertial sensor data and samples the data. The inertial sensor data includes gyroscope data and acceleration data. Motion estimation module: uses angular velocity and acceleration data to estimate the quaternion of the camera's direction; Motion smoothing module: Use velocity-damped SLERP linear interpolation to smooth the orientation quaternion of video frames; Motion compensation module: The rotation difference calculated by the quaternion before and after smoothing is converted into a rotation matrix to compensate the video frame to obtain a stable video frame.

7. A video stabilization device suitable for a motorcycle driving recorder, comprising a communication interface, a processor, an input device, a camera, an inertial sensor, a memory, and a computer program, wherein the processor runs the program in the memory, and is characterized in that: When the processor executes the program, the video stabilization method applicable to a motorcycle driving recorder according to any one of claims 1 to 5 is implemented.

Citation Information

Cited By

  • Unmanned aerial vehicle image stability enhancement method based on physical guidance

    CN119887560A