Ask Your Question

Extract point for calcOpticalFlowPyrLK and cluster

asked 2014-01-29 07:36:54 -0600

nkint gravatar image

updated 2020-10-10 13:15:05 -0600


I want to use calcOpticalFlowPyrLK to calculate optical flow inside some blob detected with Mog background subtractor. Due to the fact that LK optical flow is a sparse optical flow I have to give some points in input.

Reading on the net I have 3 possibility:

  1. Use some lattice points, dividing blob regions in grid
  2. Use goodFeatureToTrack
  3. detect cornerns with cornerHarris

Which method is preferred? Are there some benchmark or comparison?

and then cluster them., wit - for example - kmeans. On what to cluster? Position of the point and optical flow intensity? Or what else?

Thanks in advance

edit retag flag offensive close merge delete


Probably obvious, but are you trying to track blobs from MoG?

Nghia gravatar imageNghia ( 2014-01-29 07:43:31 -0600 )edit

yes but sometimes the objects merge in one big blob and I'd to split them via clustering and optical flow

nkint gravatar imagenkint ( 2014-01-31 09:24:01 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-01-31 18:32:08 -0600

Nghia gravatar image

In my experience you can get away most of the time with just tracking the binary blobs with a Kalman filter. If blobs merge together to form a big one, you tell the Kalman filter to not track the big blob and switch to prediction. If the blobs separated as predicted then you lock onto them again.

edit flag offensive delete link more

Question Tools


Asked: 2014-01-29 07:36:54 -0600

Seen: 514 times

Last updated: Jan 29 '14