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

Commit 8c401a0

Browse files
author
Simon Hofmann
committed
Updated from upstream
2 parents f24956e + 4a57f1d commit 8c401a0

30 files changed

+674
-203
lines changed

.travis.yml

Lines changed: 87 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -18,86 +18,107 @@ node_js:
1818
env:
1919
global:
2020
- OPENCV4NODEJS_DISABLE_AUTOBUILD=1
21-
matrix:
22-
# - BUILD_TASK=test
23-
# TAG=3.0.0-contrib
24-
# - BUILD_TASK=test
25-
# TAG=3.1.0-contrib
26-
# - BUILD_TASK=test
27-
# TAG=3.2.0-contrib
28-
# - BUILD_TASK=test
29-
# TAG=3.3.0-contrib
30-
# - BUILD_TASK=test
31-
# TAG=3.4.0-contrib-world
32-
# - BUILD_TASK=test
33-
# TAG=3.4.1-contrib
34-
# - BUILD_TASK=test
35-
# TAG=3.4.2-contrib
36-
# - BUILD_TASK=test
37-
# TAG=3.4.3
38-
- BUILD_TASK=test
39-
TAG=3.4.3-contrib
40-
- BUILD_TASK=prebuild
41-
TAG=3.4.3-contrib
42-
# - BUILD_TASK=cover
43-
# TAG=3.4.3-contrib
4421

4522
matrix:
4623
include:
47-
# - os: osx
48-
# node_js: '6'
49-
# env:
50-
# - BUILD_TASK=test
51-
# - os: osx
52-
# node_js: '6'
53-
# env:
54-
# - BUILD_TASK=prebuild
55-
# - os: osx
56-
# node_js: '7'
57-
# env:
58-
# - BUILD_TASK=test
59-
# - os: osx
60-
# node_js: '7'
61-
# env:
62-
# - BUILD_TASK=prebuild
63-
# - os: osx
64-
# node_js: '8'
65-
# env:
66-
# - BUILD_TASK=test
67-
# - os: osx
68-
# node_js: '8'
69-
# env:
70-
# - BUILD_TASK=prebuild
71-
# - os: osx
72-
# node_js: '9'
73-
# env:
74-
# - BUILD_TASK=test
75-
# - os: osx
76-
# node_js: '9'
77-
# env:
78-
# - BUILD_TASK=prebuild
79-
# - os: osx
80-
# node_js: '10'
81-
# env:
82-
# - BUILD_TASK=test
83-
# - os: osx
84-
# node_js: '10'
85-
# env:
86-
# - BUILD_TASK=prebuild
87-
- os: osx
24+
- os: linux
25+
env:
26+
- BUILD_TASK=test
27+
TAG=3.0.0-contrib-node6
28+
- os: linux
29+
env:
30+
- BUILD_TASK=test
31+
TAG=3.1.0-contrib-node6
32+
- os: linux
33+
env:
34+
- BUILD_TASK=test
35+
TAG=3.2.0-contrib-node6
36+
- os: linux
37+
env:
38+
- BUILD_TASK=test
39+
TAG=3.3.0-contrib-node6
40+
- os: linux
41+
env:
42+
- BUILD_TASK=test
43+
TAG=3.4.0-contrib-world-node6
44+
- os: linux
45+
env:
46+
- BUILD_TASK=test
47+
TAG=3.4.6-node6
48+
- os: linux
49+
env:
50+
- BUILD_TASK=test
51+
TAG=3.4.6-contrib-node6
52+
- os: linux
53+
env:
54+
- BUILD_TASK=test
55+
TAG=3.4.6-contrib-node8
56+
- os: linux
57+
env:
58+
- BUILD_TASK=test
59+
TAG=3.4.6-contrib-node10
60+
- os: linux
61+
env:
62+
- BUILD_TASK=cover
63+
TAG=3.4.6-contrib-node11
64+
- os: linux
65+
node_js: '6'
66+
env:
67+
- BUILD_TASK=prebuild
68+
- os: linux
69+
node_js: '8'
70+
env:
71+
- BUILD_TASK=prebuild
72+
- os: linux
73+
node_js: '10'
74+
env:
75+
- BUILD_TASK=prebuild
76+
- os: linux
77+
node_js: '11'
78+
env:
79+
- BUILD_TASK=prebuild
80+
- os: linux
8881
node_js: 'node'
82+
env:
83+
- BUILD_TASK=prebuild
84+
- os: osx
85+
node_js: '6'
8986
env:
9087
- BUILD_TASK=test
9188
- os: osx
92-
node_js: 'node'
89+
node_js: '6'
90+
env:
91+
- BUILD_TASK=prebuild
92+
- os: osx
93+
node_js: '8'
94+
env:
95+
- BUILD_TASK=test
96+
- os: osx
97+
node_js: '8'
98+
env:
99+
- BUILD_TASK=prebuild
100+
- os: osx
101+
node_js: '10'
102+
env:
103+
- BUILD_TASK=test
104+
- os: osx
105+
node_js: '10'
106+
env:
107+
- BUILD_TASK=prebuild
108+
- os: osx
109+
node_js: '11'
110+
env:
111+
- BUILD_TASK=test
112+
- os: osx
113+
node_js: '11'
93114
env:
94115
- BUILD_TASK=prebuild
95116

96117
before_install:
97118
- chmod +x ./ci/$BUILD_TASK/$BUILD_TASK.sh;
98119

99120
install:
100-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis_wait 30 docker pull justadudewhohacks/opencv4nodejs-ci:$TAG; fi
121+
- if [[ "$TRAVIS_OS_NAME" == "linux" && $TAG != "" ]]; then travis_wait 30 docker pull justadudewhohacks/opencv4nodejs-ci:$TAG; fi
101122
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew install opencv@3; brew link --force opencv@3; fi
102123

103124
script:

appveyor.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,29 @@ environment:
2222
- nodejs_version: 11
2323
PYTHON: "C:\\Python27-x64"
2424
PYTHON_VERSION: "2.7"
25-
opencv_version: 3.4.3
25+
opencv_version: 3.4.6
2626
# use self build
2727
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
2828
# node 10
2929
- nodejs_version: 10
3030
PYTHON: "C:\\Python27-x64"
3131
PYTHON_VERSION: "2.7"
32-
opencv_version: 3.4.3
33-
# use self build
34-
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
35-
# node 9
36-
- nodejs_version: 9
37-
PYTHON: "C:\\Python27-x64"
38-
PYTHON_VERSION: "2.7"
39-
opencv_version: 3.4.3
32+
opencv_version: 3.4.6
4033
# use self build
4134
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
4235
# node 8
4336
- nodejs_version: 8
4437
PYTHON: "C:\\Python27-x64"
4538
PYTHON_VERSION: "2.7"
46-
opencv_version: 3.4.3
39+
opencv_version: 3.4.6
4740
# use self build
4841
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
4942
DISABLE_ASYNC_HOOKS_TEST: 1
50-
# node 7
51-
- nodejs_version: 7
52-
PYTHON: "C:\\Python27-x64"
53-
PYTHON_VERSION: "2.7"
54-
opencv_version: 3.4.3
55-
# use self build
56-
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
5743
# node 6
5844
- nodejs_version: 6
5945
PYTHON: "C:\\Python27-x64"
6046
PYTHON_VERSION: "2.7"
61-
opencv_version: 3.4.3
47+
opencv_version: 3.4.6
6248
# use self build
6349
OPENCV4NODEJS_DISABLE_AUTOBUILD: 1
6450

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)