Search code examples
python-2.7computer-visionhomographyopticalflow

Homography and Lucas Kanade what is the difference?


i am using optical flow to track some features i am a begineer and was tol to follow these steps

  1. Match good features to track
  2. Doing Lucas-Kanade Algorithm on them
  3. Find homography between 1-st frame and current frame
  4. Do camera calibration
  5. Decompose homography map

Now what i don't understand is the homography part because you find the features and track them using Lucas-Kanade, now the homography is used to compute camera motion(rotation and translation—between two images). but isn't that what the Lucas-Kanade does? or the Lucas-Kanade just tracks them and the homography makes the calculations? I am struggling to understand the difference between them, Thanks in advance.


Solution

  • Lucas-Kanade is an algorithm to compute the optical flow, i.e. the apparent motion of pixels from one image to the next. The motion defines pixel correspondences ("matches") between pairs of frames - it says that pixel (x,y) in image t correspondes to pixel (x', y') in pixel t'. Using these correspondences (at least 4) you can estimate a geometrical transformation between the images, in particular a homography.

    Suggest you run and read the examples that come with the opencv code.