Translating and Rotating an Image in 3D using OpenCV
问题 Given a 3 x 3 rotation matrix,R, and a 3 x 1 translation matrix,T, I am wondering how to multiply the T and R matrices to an image? Lets say the Iplimage img is 640 x 480. What I want to do is R*(T*img) . I was thinking of using cvGemm, but that didn't work. 回答1: The function you are searching for is probably warpPerspective() : this is a use case... // Projection 2D -> 3D matrix Mat A1 = (Mat_<double>(4,3) << 1, 0, -w/2, 0, 1, -h/2, 0, 0, 0, 0, 0, 1); // Rotation matrices around the X axis