I would like to determine the translation and rotation of a single monocular camera (android phone) mounted on a micro helicopter. The camera has been calibrated with the chess board, so the camera matrix and distortion parameters are available. Is the following the correct procedure? The camera is moving, the background is fixed.
0) Initialize pos_R=Mat.eye(3) and pos_T=mat.zeros(3,1). 1) Store the first image in Mat img_train and use ORB detector, BRISK extractor to obtain keypoints / features 2) Store the next video image in Mat img_query, use ORB/BRISK with BF_HG radius matcher 3) Find distances between matches and keep only distances below threshold 4) On the next step, get the change in rotation and translation between the last two frames. Use either 4a or 4b 4a) Use findEssentialMat to obtain the essential matrix and recoverPose to obtain camera_R, camera_T 4b) Use solvePnP (or solvePnPRansac) to obtain camera_R, camera_T 5) Update pos_R and pos_T using gemm. pos_R = camera_R * pos_R. pos_T = pos_R * camera_T + pos_T 6) Convert to angles for display using Rodrigues 7) store query image, keypoints, and features into train image, keypoints, and features 8) Repeat starting from step 2
If we can get this working on android, we'll test it by moving the camera 1 foot forward/aft, left/right, up/down. Then rotate camera about vertical axis by 30, 60 deg, and pitch the camera by 15 deg, to see how the results look.
As the project progresses, INS will be integrated and Kalman filter implemented. Is there any video of indoor flight available for testing?