OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 25 Oct 2016 01:41:17 -0500How to obtain the estimateRigidTransform matrix using gyroscopeshttp://answers.opencv.org/question/100971/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 ](https://research.nvidia.com/sites/default/files/publications/bell_troccoli_pulli_eccv2014.pdf)
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.
Thanks in advance!
Wed, 24 Aug 2016 08:35:32 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/Answer by Tetragramm for <p>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 <a href="https://research.nvidia.com/sites/default/files/publications/bell_troccoli_pulli_eccv2014.pdf">Stabilization using gyroscopes </a></p>
<p>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)?</p>
<p>Anyone tried this kind of approach, any help could be really appreciated.</p>
<p>Thanks in advance!</p>
http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?answer=100987#post-id-100987You see that paper? You see Equation (2) and (3)? You see the part K*R(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]
Wed, 24 Aug 2016 18:03:56 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?answer=100987#post-id-100987Comment by z.s for <p>You see that paper? You see Equation (2) and (3)? You see the part K<em>R(t2)</em>R(t1)^-1*K^-1? Yeah, that's the equation. And it does rotation too.</p>
<p>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.</p>
<pre><code>[ 0 1 0]
[ 1 0 0]
[ 0 0 -1]
</code></pre>
http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=106640#post-id-106640Hi, did you implement the Stabilization of the Video ? Tue, 25 Oct 2016 01:30:55 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=106640#post-id-106640Comment by Tetragramm for <p>You see that paper? You see Equation (2) and (3)? You see the part K<em>R(t2)</em>R(t1)^-1*K^-1? Yeah, that's the equation. And it does rotation too.</p>
<p>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.</p>
<pre><code>[ 0 1 0]
[ 1 0 0]
[ 0 0 -1]
</code></pre>
http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=101015#post-id-101015i) http://lmgtfy.com/?q=android+gyroscope+basics&l=1
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.Thu, 25 Aug 2016 07:38:29 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=101015#post-id-101015Comment by Karthikeyan for <p>You see that paper? You see Equation (2) and (3)? You see the part K<em>R(t2)</em>R(t1)^-1*K^-1? Yeah, that's the equation. And it does rotation too.</p>
<p>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.</p>
<pre><code>[ 0 1 0]
[ 1 0 0]
[ 0 0 -1]
</code></pre>
http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=100998#post-id-100998Thanks 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?Thu, 25 Aug 2016 01:15:23 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=100998#post-id-100998Comment by berak for <p>You see that paper? You see Equation (2) and (3)? You see the part K<em>R(t2)</em>R(t1)^-1*K^-1? Yeah, that's the equation. And it does rotation too.</p>
<p>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.</p>
<pre><code>[ 0 1 0]
[ 1 0 0]
[ 0 0 -1]
</code></pre>
http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=106646#post-id-106646@z.s please do not write answers, if you have a comment or question.Tue, 25 Oct 2016 01:41:17 -0500http://answers.opencv.org/question/100971/how-to-obtain-the-estimaterigidtransform-matrix-using-gyroscopes/?comment=106646#post-id-106646