Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to extract Angle , Scale , transition and shear for rotated and scaled object

$
0
0
I 'm using the following sample [Features2D + Homography to find a known object] (http://docs.opencv.org/2.4/doc/tutorials/features2d/feature_homography/feature_homography.html) to find rotated and scaled object . it works fine to detect the object , the object is saved without scale , without rotation , and without shear now i want get the original image scene back after denoising it, so i need to calculate the following:
-Rotation angle
-Scale
-Shear angle
-transation
so the my question is how to use the Homography matrix in the sample to get the mentioned values had tryed to get the recovered (denoised) image by using wrapperspective with WARP_INVERSE_MAP but the image not converted correctly Here it 's object image i used ![image description](/upfiles/14804375986478971.png) and here it's the scene image i used ![image description](/upfiles/14804376603722508.jpg) then after calculating Homography matrix H as described in the sample i used the following code Mat img_Recovered; warpPerspective(img_scene,img_Recovered,H,img_scene.size(),CV_INTER_LANCZOS4+WARP_INVERSE_MAP); i got the following image ![image description](/upfiles/14804379443071238.png) as you see the recovered image does not returned correctly , i noticed that the recoverd image is drawn from starting point of object , there is alot of question here
1-how to caluate the correct image size of the recoverd image
2-how to get the recoverd image correctly
3-how to get the object rectangle in the recovered image
4-how to know the rotation angle and scale
thanks for help

Viewing all articles
Browse latest Browse all 19555

Trending Articles