node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

calcOpticalFlowPyrLK is not a function

Open ZacharAdn opened this issue 8 years ago • 2 comments

Hello, The example of optical-flow doesn't work for me

var flow = old_frame.calcOpticalFlowPyrLK(newFrame, goodFeatures, lk_params.winSize, lk_params.maxLevel, lk_params.criteria); ^ TypeError: old_frame.calcOpticalFlowPyrLK is not a function at /home/zahar/workplace/openCV/node-opencv/examples/optical-flow.js:44:30

what causes this?

ZacharAdn avatar Apr 16 '17 15:04 ZacharAdn

I'm getting the same error. When I examine the methods attached to the Matrix prototype in node, calcOpticalFlowPyrLK isn't even listed.

rtzm avatar Jun 05 '17 20:06 rtzm

@ZaharAd I was able to fix this by using the github master branch instead of the version installed automatically by npm. The version on npm doesn't have these features yet, but the github version does. The dependencies in your package.json should look something like this to use the github version, at least until they update the version on npm:

"dependencies": {
    "opencv": "git://github.com/peterbraden/node-opencv.git"
  },

rtzm avatar Jun 05 '17 22:06 rtzm