简体   繁体   中英

Identifying person using optical flow and clustering?

So I am using matlab and I've managed to modify one of their examples so that I can now plot the flow lines as people walk below (Camera is above a door). I use Lucas-Kanade optical flow and the computer vision toolbox.

The lines are defined like so, I also defined the tracked points. These tracked points include cases where the original points haven't changed and so the real(tmp(:)) in this case will be zero and those points will be the same as the orgininally identified feature points.

vel_Lines = [Y(:)   X(:)   Y(:)+real(tmp(:))   X(:)+imag(tmp(:))];
allTrackedPoints = [Y(:)+real(tmp(:))   X(:)+imag(tmp(:))]; 

My question is how can I JUST get the points which have successfully been tracked a certain distance? I want to somehow only retain values which the change is large enough.

I'm not great with Matlab's syntax so was hoping this would be easy for someone.

I want to get the points that were successfuly tracked pertaining to the motion, then cluster these points to determine how many people, and then tracked these sets of points using a multiple object tracker.

If your camera is not moving, then background subtraction may work better for you than optical flow. See this example.

You can also use the vision.PeopleDetector object to detect people. See this example .

If you insist on using optical flow, try the Fareneback optical flow algorithm , available as of R2015b release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM