#include "opencv_modules.h" #ifdef HAVE_OPENCV_FEATURES2D #include "FASTDetector.h" Nan::Persistent FASTDetector::constructor; NAN_MODULE_INIT(FASTDetector::Init) { v8::Local ctor = Nan::New(FASTDetector::New); v8::Local instanceTemplate = ctor->InstanceTemplate(); FeatureDetector::Init(ctor); constructor.Reset(ctor); ctor->SetClassName(Nan::New("FASTDetector").ToLocalChecked()); instanceTemplate->SetInternalFieldCount(1); Nan::SetAccessor(instanceTemplate, Nan::New("threshold").ToLocalChecked(), threshold_getter); Nan::SetAccessor(instanceTemplate, Nan::New("nonmaxSuppression").ToLocalChecked(), nonmaxSuppression_getter); Nan::SetAccessor(instanceTemplate, Nan::New("type").ToLocalChecked(), type_getter); Nan::Set(target,Nan::New("FASTDetector").ToLocalChecked(), FF::getFunction(ctor)); #if CV_VERSION_GREATER_EQUAL(4, 0, 0) DetectorType::init(target); #endif }; NAN_METHOD(FASTDetector::New) { NewBinding().construct(info); } #endif