# Extracting trans,rot and scale from homography matrix

6 messages
Open this post in threaded view
|

## Extracting trans,rot and scale from homography matrix

 With FeatureDetector I get features on two images with the same element and match this features with BruteForceMatcher. Then I'm using OpenCv function findHomography to get homography matrix H = findHomography( src2Dfeatures, dst2Dfeatures, outlierMask,       RANSAC,3); and getting H matrix, then align image with: warpPerspective(img1,alignedSrcImage,H,img2.size(),INTER_LINEAR,BORDER_C                ONSTANT); I need to know rotation angle, scale, displacement of detected element. Is there any simple way to get this than some big equations? Some evaluated formulas just to put data in?
Open this post in threaded view
|

## RE: Extracting trans,rot and scale from homography matrix

 It is a complicate problem. But this may inspire you. http://hal.inria.fr/docs/00/17/47/39/PDF/RR-6303.pdf    From: [hidden email] [mailto:[hidden email]] On Behalf Of krzych07 Sent: Friday, November 18, 2011 6:45 AM To: [hidden email] Subject: [OpenCV] Extracting trans,rot and scale from homography matrix     With FeatureDetector I get features on two images with the same element and match this features with BruteForceMatcher. Then I'm using OpenCv function findHomography to get homography matrix H = findHomography( src2Dfeatures, dst2Dfeatures, outlierMask, RANSAC,3); and getting H matrix, then align image with: warpPerspective(img1,alignedSrcImage,H,img2.size(),INTER_LINEAR,BORDER_C ONSTANT); I need to know rotation angle, scale, displacement of detected element. Is there any simple way to get this than some big equations? Some evaluated formulas just to put data in?
Open this post in threaded view
|

## Re: Extracting trans,rot and scale from homography matrix

 from essential matrix we can calculate rotation and translation between images. An SVD of [image: \mathbf{E}] gives [image: \mathbf{E} = \mathbf{U} \, \mathbf{\Sigma} \, \mathbf{V}^{T}][image: [\mathbf{t}]_{\times} = \mathbf{V} \, \mathbf{W} \, \mathbf{\Sigma} \, \mathbf{V}^{T}] [image: \mathbf{R} = \mathbf{U} \, \mathbf{W}^{-1} \, \mathbf{V}^{T}] [image: [\mathbf{t}]_{\times} = \mathbf{V} \, \mathbf{Z} \, \mathbf{V}^{T}]  with   [image: \mathbf{Z} = \begin{pmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}]http://en.wikipedia.org/wiki/Essential_matrixOn Fri, Nov 18, 2011 at 9:14 PM, lood339 <[hidden email]> wrote: > ** > > > It is a complicate problem. But this may inspire you. > http://hal.inria.fr/docs/00/17/47/39/PDF/RR-6303.pdf****> > ** ** > > ** ** > > *From:* [hidden email] [mailto:[hidden email]] *On Behalf > Of *krzych07 > *Sent:* Friday, November 18, 2011 6:45 AM > *To:* [hidden email] > *Subject:* [OpenCV] Extracting trans,rot and scale from homography matrix* > *** > > ** ** > >   **** > > With FeatureDetector I get features on two images with the same element > and match this features with BruteForceMatcher. Then I'm using OpenCv > function findHomography to get homography matrix > > H = findHomography( src2Dfeatures, dst2Dfeatures, outlierMask, > RANSAC,3); > and getting H matrix, then align image with: > > warpPerspective(img1,alignedSrcImage,H,img2.size(),INTER_LINEAR,BORDER_C > ONSTANT); > > I need to know rotation angle, scale, displacement of detected element. Is > there any simple way to get this than some big equations? Some evaluated > formulas just to put data in?**** > > **** > >   >
Open this post in threaded view
|

## RE: Extracting trans,rot and scale from homography matrix

 We can get R, T from essential matrix, but the pre-requirement of essential matrix is the calibration of camera.   From: [hidden email] [mailto:[hidden email]] On Behalf Of Yaswanth Gavini Sent: Friday, November 18, 2011 9:35 PM To: [hidden email] Subject: Re: [OpenCV] Extracting trans,rot and scale from homography matrix     from essential matrix we can calculate rotation and translation between images.   An SVD of   \mathbf{E} gives   \mathbf{E} = \mathbf{U} \, \mathbf{\Sigma} \, \mathbf{V}^{T}   [\mathbf{t}]_{\times} = \mathbf{V} \, \mathbf{W} \, \mathbf{\Sigma} \, \mathbf{V}^{T}   \mathbf{R} = \mathbf{U} \, \mathbf{W}^{-1} \, \mathbf{V}^{T}     [\mathbf{t}]_{\times} = \mathbf{V} \, \mathbf{Z} \, \mathbf{V}^{T}   with     \mathbf{Z} = \begin{pmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix} http://en.wikipedia.org/wiki/Essential_matrixOn Fri, Nov 18, 2011 at 9:14 PM, lood339 <[hidden email]> wrote:   It is a complicate problem. But this may inspire you. http://hal.inria.fr/docs/00/17/47/39/PDF/RR-6303.pdf    From: [hidden email] [mailto:[hidden email]] On Behalf Of krzych07 Sent: Friday, November 18, 2011 6:45 AM To: [hidden email] Subject: [OpenCV] Extracting trans,rot and scale from homography matrix     With FeatureDetector I get features on two images with the same element and match this features with BruteForceMatcher. Then I'm using OpenCv function findHomography to get homography matrix H = findHomography( src2Dfeatures, dst2Dfeatures, outlierMask, RANSAC,3); and getting H matrix, then align image with: warpPerspective(img1,alignedSrcImage,H,img2.size(),INTER_LINEAR,BORDER_C ONSTANT); I need to know rotation angle, scale, displacement of detected element. Is there any simple way to get this than some big equations? Some evaluated formulas just to put data in?