forked from udarrr/opencv4nodejs-prebuilt-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSURFDetector.cc
32 lines (22 loc) · 1.19 KB
/
SURFDetector.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "opencv_modules.h"
#ifdef HAVE_OPENCV_XFEATURES2D
#include "SURFDetector.h"
Nan::Persistent<v8::FunctionTemplate> SURFDetector::constructor;
NAN_MODULE_INIT(SURFDetector::Init) {
v8::Local<v8::FunctionTemplate> ctor = Nan::New<v8::FunctionTemplate>(SURFDetector::New);
v8::Local<v8::ObjectTemplate> instanceTemplate = ctor->InstanceTemplate();
FeatureDetector::Init(ctor);
constructor.Reset(ctor);
instanceTemplate->SetInternalFieldCount(1);
ctor->SetClassName(Nan::New("SURFDetector").ToLocalChecked());
Nan::SetAccessor(instanceTemplate, Nan::New("hessianThreshold").ToLocalChecked(), hessianThreshold_getter);
Nan::SetAccessor(instanceTemplate, Nan::New("nOctaves").ToLocalChecked(), nOctaves_getter);
Nan::SetAccessor(instanceTemplate, Nan::New("nOctaveLayers").ToLocalChecked(), nOctaveLayers_getter);
Nan::SetAccessor(instanceTemplate, Nan::New("extended").ToLocalChecked(), extended_getter);
Nan::SetAccessor(instanceTemplate, Nan::New("upright").ToLocalChecked(), upright_getter);
Nan::Set(target,Nan::New("SURFDetector").ToLocalChecked(), FF::getFunction(ctor));
};
NAN_METHOD(SURFDetector::New) {
constructorBinding<Constructor>(info);
}
#endif // HAVE_OPENCV_XFEATURES2D