Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 2d671bb

Browse files
author
Simon Hofmann
committed
Updated from upstream
2 parents 279b191 + 7a79113 commit 2d671bb

30 files changed

+607
-2136
lines changed

.travis.yml

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
- docker
77

88
node_js:
9+
# node version does not matter here, since we run builds with docker
910
- '6'
1011
- '7'
1112
- '8'
@@ -18,27 +19,37 @@ env:
1819
- OPENCV4NODEJS_DISABLE_AUTOBUILD=1
1920
matrix:
2021
- BUILD_TASK=test
21-
TAG=3.0.0-contrib
22+
TAG=3.0.0-contrib-node6
2223
- BUILD_TASK=test
23-
TAG=3.1.0-contrib
24+
TAG=3.1.0-contrib-node6
2425
- BUILD_TASK=test
25-
TAG=3.2.0-contrib
26+
TAG=3.2.0-contrib-node6
2627
- BUILD_TASK=test
27-
TAG=3.3.0-contrib
28+
TAG=3.3.0-contrib-node6
29+
- BUILD_TASK=cover
30+
TAG=3.4.0-contrib-node6
31+
- BUILD_TASK=test
32+
TAG=3.4.0-contrib-world-node6
2833
- BUILD_TASK=test
29-
TAG=3.4.0-contrib-world
34+
TAG=3.4.6-node6
3035
- BUILD_TASK=test
31-
TAG=3.4.1-contrib
36+
TAG=3.4.6-contrib-node6
3237
- BUILD_TASK=test
33-
TAG=3.4.2-contrib
38+
TAG=3.4.6-contrib-node8
3439
- BUILD_TASK=test
35-
TAG=3.4.3
40+
TAG=3.4.6-contrib-node10
3641
- BUILD_TASK=test
37-
TAG=3.4.3-contrib
42+
TAG=3.4.6-contrib-node11
43+
- BUILD_TASK=prebuild
44+
TAG=3.4.6-contrib-node6
45+
- BUILD_TASK=prebuild
46+
TAG=3.4.6-contrib-node8
47+
- BUILD_TASK=prebuild
48+
TAG=3.4.6-contrib-node10
3849
- BUILD_TASK=prebuild
39-
TAG=3.4.3-contrib
50+
TAG=3.4.6-contrib-node11
4051
- BUILD_TASK=cover
41-
TAG=3.4.3-contrib
52+
TAG=3.4.6-contrib-node10
4253

4354
matrix:
4455
include:
@@ -50,14 +61,6 @@ matrix:
5061
node_js: '6'
5162
env:
5263
- BUILD_TASK=prebuild
53-
- os: osx
54-
node_js: '7'
55-
env:
56-
- BUILD_TASK=test
57-
- os: osx
58-
node_js: '7'
59-
env:
60-
- BUILD_TASK=prebuild
6164
- os: osx
6265
node_js: '8'
6366
env:
@@ -66,14 +69,6 @@ matrix:
6669
node_js: '8'
6770
env:
6871
- BUILD_TASK=prebuild
69-
- os: osx
70-
node_js: '9'
71-
env:
72-
- BUILD_TASK=test
73-
- os: osx
74-
node_js: '9'
75-
env:
76-
- BUILD_TASK=prebuild
7772
- os: osx
7873
node_js: '10'
7974
env:
@@ -83,11 +78,11 @@ matrix:
8378
env:
8479
- BUILD_TASK=prebuild
8580
- os: osx
86-
node_js: 'node'
81+
node_js: '11'
8782
env:
8883
- BUILD_TASK=test
8984
- os: osx
90-
node_js: 'node'
85+
node_js: '11'
9186
env:
9287
- BUILD_TASK=prebuild
9388

binding.gyp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
"cc/modules/tracking/Trackers/TrackerMedianFlow.cc",
8989
"cc/modules/tracking/Trackers/TrackerTLD.cc",
9090
"cc/modules/tracking/Trackers/TrackerGOTURN.cc",
91+
"cc/modules/tracking/Trackers/TrackerCSRT.cc",
92+
"cc/modules/tracking/Trackers/TrackerCSRTParams.cc",
93+
"cc/modules/tracking/Trackers/TrackerMOSSE.cc",
9194
"cc/modules/features2d/features2d.cc",
9295
"cc/modules/features2d/KeyPoint.cc",
9396
"cc/modules/features2d/KeyPointMatch.cc",

cc/macros.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static FF_FUNC_TYPE ff_func = FF_FUNC_TYPE();
111111
#define FF_SETTER_UINT(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_uint)
112112
#define FF_SETTER_NUMBER(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_number)
113113
#define FF_SETTER_BOOL(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_bool)
114+
#define FF_SETTER_STRING(clazz, name, prop) FF_SETTER(clazz, name, prop, ff_string)
114115

115116
#define FF_SETTER_SIMPLE(clazz, name, prop, converter) \
116117
NAN_SETTER(name##Set) { \

cc/modules/objdetect/HOGDescriptor.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ NAN_METHOD(HOGDescriptor::New) {
8585
}
8686

8787
HOGDescriptor* self = new HOGDescriptor();
88-
self->hog = cv::HOGDescriptor(
88+
self->hog = std::make_shared<cv::HOGDescriptor>(
8989
winSize,
9090
blockSize,
9191
blockStride,
@@ -115,7 +115,7 @@ NAN_METHOD(HOGDescriptor::GetDefaultPeopleDetector) {
115115
}
116116

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

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

130130
NAN_METHOD(HOGDescriptor::Save) {
131131
FF_METHOD_CONTEXT("HOGDescriptor::Save");
132132
FF_ARG_STRING(0, std::string path);
133-
FF_UNWRAP(info.This(), HOGDescriptor)->hog.save(path);
133+
FF_UNWRAP(info.This(), HOGDescriptor)->hog->save(path);
134134
}
135135

136136
NAN_METHOD(HOGDescriptor::Load) {
137137
FF_METHOD_CONTEXT("HOGDescriptor::Load");
138138
FF_ARG_STRING(0, std::string path);
139-
FF_UNWRAP(info.This(), HOGDescriptor)->hog.load(path);
139+
FF_UNWRAP(info.This(), HOGDescriptor)->hog->load(path);
140140
}
141141

142142
NAN_METHOD(HOGDescriptor::Compute) {

cc/modules/objdetect/HOGDescriptor.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313

1414
class HOGDescriptor : public Nan::ObjectWrap {
1515
public:
16-
cv::HOGDescriptor hog;
16+
std::shared_ptr<cv::HOGDescriptor> hog;
1717

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

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

23-
typedef InstanceConverter<HOGDescriptor, cv::HOGDescriptor> Converter;
23+
typedef InstanceConverter<HOGDescriptor, std::shared_ptr<cv::HOGDescriptor>> Converter;
2424

2525
static const char* getClassName() {
2626
return "HOGDescriptor";
2727
}
2828

29-
static FF_GETTER_JSOBJ(HOGDescriptor, winSize, hog.winSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
30-
static FF_GETTER_JSOBJ(HOGDescriptor, blockSize, hog.blockSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
31-
static FF_GETTER_JSOBJ(HOGDescriptor, blockStride, hog.blockStride, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
32-
static FF_GETTER_JSOBJ(HOGDescriptor, cellSize, hog.cellSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
33-
static FF_GETTER(HOGDescriptor, nbins, hog.nbins);
34-
static FF_GETTER(HOGDescriptor, derivAperture, hog.derivAperture);
35-
static FF_GETTER(HOGDescriptor, histogramNormType, hog.histogramNormType);
36-
static FF_GETTER(HOGDescriptor, nlevels, hog.nlevels);
37-
static FF_GETTER(HOGDescriptor, winSigma, hog.winSigma);
38-
static FF_GETTER(HOGDescriptor, L2HysThreshold, hog.L2HysThreshold);
39-
static FF_GETTER(HOGDescriptor, gammaCorrection, hog.gammaCorrection);
40-
static FF_GETTER(HOGDescriptor, signedGradient, hog.signedGradient);
29+
static FF_GETTER_JSOBJ(HOGDescriptor, winSize, hog->winSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
30+
static FF_GETTER_JSOBJ(HOGDescriptor, blockSize, hog->blockSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
31+
static FF_GETTER_JSOBJ(HOGDescriptor, blockStride, hog->blockStride, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
32+
static FF_GETTER_JSOBJ(HOGDescriptor, cellSize, hog->cellSize, FF_UNWRAP_SIZE_AND_GET, Size::constructor);
33+
static FF_GETTER(HOGDescriptor, nbins, hog->nbins);
34+
static FF_GETTER(HOGDescriptor, derivAperture, hog->derivAperture);
35+
static FF_GETTER(HOGDescriptor, histogramNormType, hog->histogramNormType);
36+
static FF_GETTER(HOGDescriptor, nlevels, hog->nlevels);
37+
static FF_GETTER(HOGDescriptor, winSigma, hog->winSigma);
38+
static FF_GETTER(HOGDescriptor, L2HysThreshold, hog->L2HysThreshold);
39+
static FF_GETTER(HOGDescriptor, gammaCorrection, hog->gammaCorrection);
40+
static FF_GETTER(HOGDescriptor, signedGradient, hog->signedGradient);
4141

4242
static NAN_MODULE_INIT(Init);
4343

0 commit comments

Comments
 (0)