robotika / simple-sfm

A readable implementation of structure-from-motion
MIT License
20 stars 3 forks source link

Add primitive visual odometry based on lk_track.py from opencv #2

Open zbynekwinkler opened 7 years ago

zbynekwinkler commented 7 years ago

lk_track.py from opencv samples shows how to track a set of point between images. Use that plus cv2.findEssentialMat() to recover relative pose between frames using cv2.recoverPose(). Somewhat like visual odomery tutorial .

zbynekwinkler commented 7 years ago

Bonus feature would be to separately track inliers corresponding to the change of the camera pose and possibly some other groups corresponding to moving objects.

zbynekwinkler commented 7 years ago

Actually, let's assume a static scene and leave object tracking for later.

zbynekwinkler commented 7 years ago

Just doing a quick timing on the lk_track.py example from opencv. On computer i5 at 1.7GHz and 640x480 picture from the built in camera the tracking step takes around 4ms and the detect step around 11ms. Detecting new features to track is done on every 5th frame. Amortizing this we get 6ms per frame. FPS is a bit over 30.

Summarizing, it is using about 20% of one core.

zbynekwinkler commented 7 years ago

Can be tested at 770a1bf38d6e6a4ba7e929e01e313b727ea639eb.