diff --git a/src/Matrix.cc b/src/Matrix.cc index e8ccfe3..099ffe2 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -83,7 +83,9 @@ void Matrix::Init(Local target) { Nan::SetPrototypeMethod(ctor, "drawContour", DrawContour); Nan::SetPrototypeMethod(ctor, "drawAllContours", DrawAllContours); Nan::SetPrototypeMethod(ctor, "goodFeaturesToTrack", GoodFeaturesToTrack); + #ifdef HAVE_OPENCV_VIDEO Nan::SetPrototypeMethod(ctor, "calcOpticalFlowPyrLK", CalcOpticalFlowPyrLK); + #endif Nan::SetPrototypeMethod(ctor, "houghLinesP", HoughLinesP); Nan::SetPrototypeMethod(ctor, "houghCircles", HoughCircles); Nan::SetPrototypeMethod(ctor, "inRange", inRange); @@ -651,7 +653,7 @@ NAN_METHOD(Matrix::PixelCol) { int height = self->mat.size().height; int x = info[0]->IntegerValue(); v8::Local < v8::Array > arr; - + if (self->mat.channels() == 4) { arr = Nan::New(height * 4); for (int y = 0; y < height; y++) { @@ -1697,6 +1699,7 @@ NAN_METHOD(Matrix::GoodFeaturesToTrack) { info.GetReturnValue().Set(arr); } +#ifdef HAVE_OPENCV_VIDEO NAN_METHOD(Matrix::CalcOpticalFlowPyrLK) { Nan::HandleScope scope; @@ -1773,6 +1776,7 @@ NAN_METHOD(Matrix::CalcOpticalFlowPyrLK) { info.GetReturnValue().Set(data); } +#endif NAN_METHOD(Matrix::HoughLinesP) { Nan::HandleScope scope; diff --git a/src/Matrix.h b/src/Matrix.h index 15799dd..5033c61 100755 --- a/src/Matrix.h +++ b/src/Matrix.h @@ -90,7 +90,9 @@ public: // Feature Detection JSFUNC(GoodFeaturesToTrack) + #ifdef HAVE_OPENCV_VIDEO JSFUNC(CalcOpticalFlowPyrLK) + #endif JSFUNC(HoughLinesP) JSFUNC(HoughCircles)