Skip to content

Commit

Permalink
Merge branch 'master' into undistort
Browse files Browse the repository at this point in the history
  • Loading branch information
piercus committed May 6, 2019
2 parents 4241a8c + 7a79113 commit e2f4438
Show file tree
Hide file tree
Showing 29 changed files with 614 additions and 142 deletions.
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
language: node_js

node_js:
# node version does not matter here, since we run builds with docker
- '6'
- '8'
- '10'
- 'node'

sudo: required

Expand All @@ -13,25 +11,27 @@ services:

env:
- BUILD_TASK=test
TAG=3.0.0-contrib
TAG=3.0.0-contrib-node6
- BUILD_TASK=test
TAG=3.1.0-contrib
TAG=3.1.0-contrib-node6
- BUILD_TASK=test
TAG=3.2.0-contrib
TAG=3.2.0-contrib-node6
- BUILD_TASK=test
TAG=3.3.0-contrib
TAG=3.3.0-contrib-node6
- BUILD_TASK=cover
TAG=3.4.0-contrib
TAG=3.4.0-contrib-node6
- BUILD_TASK=test
TAG=3.4.0-contrib-world
TAG=3.4.0-contrib-world-node6
- BUILD_TASK=test
TAG=3.4.1-contrib
TAG=3.4.6-node6
- BUILD_TASK=test
TAG=3.4.2-contrib
TAG=3.4.6-contrib-node6
- BUILD_TASK=test
TAG=3.4.3
TAG=3.4.6-contrib-node8
- BUILD_TASK=test
TAG=3.4.3-contrib
TAG=3.4.6-contrib-node10
- BUILD_TASK=test
TAG=3.4.6-contrib-node11

before_install:
- chmod +x ./ci/$BUILD_TASK/$BUILD_TASK.sh
Expand Down
3 changes: 3 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
"cc/modules/tracking/Trackers/TrackerMedianFlow.cc",
"cc/modules/tracking/Trackers/TrackerTLD.cc",
"cc/modules/tracking/Trackers/TrackerGOTURN.cc",
"cc/modules/tracking/Trackers/TrackerCSRT.cc",
"cc/modules/tracking/Trackers/TrackerCSRTParams.cc",
"cc/modules/tracking/Trackers/TrackerMOSSE.cc",
"cc/modules/features2d/features2d.cc",
"cc/modules/features2d/KeyPoint.cc",
"cc/modules/features2d/KeyPointMatch.cc",
Expand Down
1 change: 1 addition & 0 deletions cc/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static FF_FUNC_TYPE ff_func = FF_FUNC_TYPE();
#define FF_SETTER_UINT(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_uint)
#define FF_SETTER_NUMBER(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_number)
#define FF_SETTER_BOOL(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_bool)
#define FF_SETTER_STRING(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_string)

#define FF_SETTER_SIMPLE(clazz, name, prop, converter) \
NAN_SETTER(name##Set) { \
Expand Down
10 changes: 5 additions & 5 deletions cc/modules/objdetect/HOGDescriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ NAN_METHOD(HOGDescriptor::New) {
}

HOGDescriptor* self = new HOGDescriptor();
self->hog = cv::HOGDescriptor(
self->hog = std::make_shared<cv::HOGDescriptor>(
winSize,
blockSize,
blockStride,
Expand Down Expand Up @@ -115,7 +115,7 @@ NAN_METHOD(HOGDescriptor::GetDefaultPeopleDetector) {
}

NAN_METHOD(HOGDescriptor::CheckDetectorSize) {
FF_RETURN(Nan::New(HOGDescriptor::Converter::unwrap(info.This()).checkDetectorSize()));
FF_RETURN(Nan::New(HOGDescriptor::Converter::unwrap(info.This())->checkDetectorSize()));
}

NAN_METHOD(HOGDescriptor::SetSVMDetector) {
Expand All @@ -124,19 +124,19 @@ NAN_METHOD(HOGDescriptor::SetSVMDetector) {
if (!FF_HAS_ARG(0) || FloatArrayConverter::unwrap(&detector, info[0])) {
FF_THROW("expected detector to be an Array of type Number");
}
HOGDescriptor::Converter::unwrapPtr(info.This())->setSVMDetector(detector);
HOGDescriptor::Converter::unwrap(info.This())->setSVMDetector(detector);
}

NAN_METHOD(HOGDescriptor::Save) {
FF_METHOD_CONTEXT("HOGDescriptor::Save");
FF_ARG_STRING(0, std::string path);
FF_UNWRAP(info.This(), HOGDescriptor)->hog.save(path);
FF_UNWRAP(info.This(), HOGDescriptor)->hog->save(path);
}

NAN_METHOD(HOGDescriptor::Load) {
FF_METHOD_CONTEXT("HOGDescriptor::Load");
FF_ARG_STRING(0, std::string path);
FF_UNWRAP(info.This(), HOGDescriptor)->hog.load(path);
FF_UNWRAP(info.This(), HOGDescriptor)->hog->load(path);
}

NAN_METHOD(HOGDescriptor::Compute) {
Expand Down
32 changes: 16 additions & 16 deletions cc/modules/objdetect/HOGDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@

class HOGDescriptor : public Nan::ObjectWrap {
public:
cv::HOGDescriptor hog;
std::shared_ptr<cv::HOGDescriptor> hog;

static Nan::Persistent<v8::FunctionTemplate> constructor;

cv::HOGDescriptor* getNativeObjectPtr() { return &hog; }
cv::HOGDescriptor getNativeObject() { return hog; }
cv::HOGDescriptor* getNativeObjectPtr() { return hog.get(); }
std::shared_ptr<cv::HOGDescriptor> getNativeObject() { return hog; }

typedef InstanceConverter<HOGDescriptor, cv::HOGDescriptor> Converter;
typedef InstanceConverter<HOGDescriptor, std::shared_ptr<cv::HOGDescriptor>> Converter;

static const char* getClassName() {
return "HOGDescriptor";
}

static FF_GETTER_JSOBJ(HOGDescriptor, winSize, hog.winSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, blockSize, hog.blockSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, blockStride, hog.blockStride, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, cellSize, hog.cellSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER(HOGDescriptor, nbins, hog.nbins);
static FF_GETTER(HOGDescriptor, derivAperture, hog.derivAperture);
static FF_GETTER(HOGDescriptor, histogramNormType, hog.histogramNormType);
static FF_GETTER(HOGDescriptor, nlevels, hog.nlevels);
static FF_GETTER(HOGDescriptor, winSigma, hog.winSigma);
static FF_GETTER(HOGDescriptor, L2HysThreshold, hog.L2HysThreshold);
static FF_GETTER(HOGDescriptor, gammaCorrection, hog.gammaCorrection);
static FF_GETTER(HOGDescriptor, signedGradient, hog.signedGradient);
static FF_GETTER_JSOBJ(HOGDescriptor, winSize, hog->winSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, blockSize, hog->blockSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, blockStride, hog->blockStride, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER_JSOBJ(HOGDescriptor, cellSize, hog->cellSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
static FF_GETTER(HOGDescriptor, nbins, hog->nbins);
static FF_GETTER(HOGDescriptor, derivAperture, hog->derivAperture);
static FF_GETTER(HOGDescriptor, histogramNormType, hog->histogramNormType);
static FF_GETTER(HOGDescriptor, nlevels, hog->nlevels);
static FF_GETTER(HOGDescriptor, winSigma, hog->winSigma);
static FF_GETTER(HOGDescriptor, L2HysThreshold, hog->L2HysThreshold);
static FF_GETTER(HOGDescriptor, gammaCorrection, hog->gammaCorrection);
static FF_GETTER(HOGDescriptor, signedGradient, hog->signedGradient);

static NAN_MODULE_INIT(Init);

Expand Down
Loading

0 comments on commit e2f4438

Please sign in to comment.