I am doing Monocular Visual Odometry, and I have problem with relative scale. Most of the time its value is between 0.8-1.1, but sometimes it goes crazy and it has value 3,4 and once it had value 25. This ruins me my translation vector t, and then my vehicle trajectory become shifted a lot. I extracted 3D points normally, I can't resolve why this is happening. I don't know if 3D points cloud making this problem, but I used
triangulatePoints method for getting 3D points. For relative scale, I take median of all calculated distances between points of 3D cloud.
Does inliers and outliers have something to do with this problem? Should I get rid of all outliers first? I mean there are not too many outliers in keypoints set.
P.S. I tested this for 2 datasets. One had about 110 frames, and another had about 20 frames. One with 20 frames had no problems, this with 110 frames had problems. Relative scale had value 25 when I was computing it between frames 3 and 4. It is dataset from KITTI. You can find it on KITTI webpage: Raw data - 2011_09_28_drive_0001 (name of dataset).
I hope you will help me to understand why this is happening.
Note: KITTI dataset is stereo camera. So I used right camera as monocular.