GFTTDetector and calcOpticalFlowPyrLK

asked 2015-08-27 08:02:28 -0600

LBerger gravatar image

Hi,

Previously I was using good featuresToTrack and calcOpticalFlowPyrLK to match features.

Now I want to use new interface GFTT. In BFMatcher I cannot find an algorithm like calcOpticalFlowPyrLK. So (I think) I need to use previous function calcOpticalFlowPyrLK. But function argument is InputArray prevPts for Point (and not keyPoints).

Must I convert keyPoint in cv::Point2f to use this function?

Thanks for your help

edit retag flag offensive close merge delete

Comments

an example for using optical flow with matching would be nice.

berak gravatar imageberak ( 2015-08-27 08:25:18 -0600 )edit

I'm not sure to understand. there is already an example

LBerger gravatar imageLBerger ( 2015-08-27 10:24:27 -0600 )edit

i meant in connection with the BFMatcher, but yes.

berak gravatar imageberak ( 2015-08-27 10:27:46 -0600 )edit

I'm not sure to understand so I give you my understanding of GFTT and Orb (for example)

With GFTT keyPoint are calculated by thresholding cornerMinEigenVal. After there is no descriptors.

With Orb pointare calculated using FastFeatureDetector and descriptor using compute (computeOrbDescriptors).

BFMatcher need descriptor. As there is no descriptor with GFTT I understand that I must provided some descriptors. I can imagine now that I use

  1. an existing descriptor with GFTT keyPoint
  2. opticalFlowPyramid to build a new descriptor.

I don't like 2 so Do you need an example with 1?Result would be like github.com/Itseez/opencv/blob/master/samples/tapi/pyrlk_optical_flow.cpp

LBerger gravatar imageLBerger ( 2015-08-28 06:46:38 -0600 )edit

@berak what's new about my comment?

LBerger gravatar imageLBerger ( 2015-08-29 03:51:27 -0600 )edit

sorry, i was busy battling the buildbot ;)

maybe i do not understand your workflow here.

so, you are collecting "points of interest" , then use optical flow (which will give you the offset for those points from one image to another), and then ? (what is the result used for ?)

what are your "features" ? if you want to use feature2d classes to get features for matching, you might need a more suitable Keypoint extractor, GFFT is lacking things like scale, octave and such.

if so, also you should rather use detectAndCompute() (not seperate) for most feature2d classes, else you throw away already extracted features

berak gravatar imageberak ( 2015-08-29 04:17:12 -0600 )edit

I wanted to use GFFT only to have a universal (ORB KAZE...GFTT)code for matching. Now I know it's not possible.

LBerger gravatar imageLBerger ( 2015-08-29 10:40:50 -0600 )edit