cv.calcOpticalFlowPyrLK in OpenCV.js

asked 2018-08-23 17:38:25 -0500

Danimal gravatar image

I'd like to use cv.calcOpticalFlowPyrLK to track points clicked on by a user in an image, and I can identify the coordinates of the click on an image no problem. I generate a cv.Point(x,y) with the values, but how can I convert this to what's needed for the current position input for the flow? I've seen the box tracking example but have no idea what data type the p0 is there or how to convert to it from a point in Javascript. I'm using the most recent master build of OpenCV.js

Thanks!

edit retag flag offensive close merge delete

Comments

p0 and p1 there are of type cv.Mat (and there is an example, how to construct a cv.Mat from points in L. 127)

track points clicked on by a user

that does not sound like a good idea to me. you cannot use arbitrary points here, but it needs corner points, like from gfft, or harris, that can be easily found again in the next iteration

berak gravatar imageberak ( 2018-08-25 00:38:15 -0500 )edit