# How to obtain the estimateRigidTransform matrix using gyroscopes

I have a video feed which is taken with a moving camera and I have the corresponding gyroscope values for each frame data. I have seen a paper implementation to stabilize the video using the gyroscope data Stabilization using gyroscopes

I would like to stabilize the video, basically estimate a transormation matrix between two corresponding frames (in Translation and rotation) using this gyroscope data instead of image data(finding feature points). How can I correlate the gyroscope values in estimating this translation offsets in x and y axes atleast(for now rotation is next in my priority list)?

Anyone tried this kind of approach, any help could be really appreciated.

edit retag close merge delete

Sort by ยป oldest newest most voted

You see that paper? You see Equation (2) and (3)? You see the part KR(t2)R(t1)^-1*K^-1? Yeah, that's the equation. And it does rotation too.

Your gyroscope API should return a rotation matrix. You may need to use Eq (3) where the T matrix switches the rows (I think it's rows) to match the camera coordinate system. T would look something like this (I just picked a possible one) with several ones (and possible -1s). Assuming the axes of your gyroscopes are parallel to the camera. If not, it's a more complicated rotation.

[ 0  1  0]
[ 1  0  0]
[ 0  0 -1]

more

Thanks a lot @Tetragramm for you answer. Please share some more thoughts on the following, (i) The gyroscope data I get is the angular velocity in degrees per second(dps) along the three axis. From this How to estimate a rotation matrix? (ii) I understand completelty T is just a permutation matrix as you said but How to determine a particular T, as there are several combinations?

( 2016-08-25 01:15:23 -0500 )edit

ii) Either know the coordinate frame of the gyro and your camera, and rotate the one to match the other, or trial and error. If you know it, you know it. Otherwise you start switching axes until you get good results.

( 2016-08-25 07:38:29 -0500 )edit

Hi, did you implement the Stabilization of the Video ?

( 2016-10-25 01:30:55 -0500 )edit

@z.s please do not write answers, if you have a comment or question.

( 2016-10-25 01:41:17 -0500 )edit