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

Commit 8f41516

Browse files
committed
Merge branch 'master' into feature/bfmatcher
2 parents 410e37b + 6867cfe commit 8f41516

37 files changed

+771
-4134
lines changed

.travis.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,18 @@ services:
1010

1111
matrix:
1212
include:
13-
- env:
14-
- BUILD_TASK=test
15-
- TAG=3.0.0
1613
- env:
1714
- BUILD_TASK=test
1815
- TAG=3.0.0-contrib
19-
- env:
20-
- BUILD_TASK=test
21-
- TAG=3.1.0
2216
- env:
2317
- BUILD_TASK=test
2418
- TAG=3.1.0-contrib
25-
- env:
26-
- BUILD_TASK=test
27-
- TAG=3.2.0
2819
- env:
2920
- BUILD_TASK=test
3021
- TAG=3.2.0-contrib
31-
- env:
32-
- BUILD_TASK=test
33-
- TAG=3.3.0
3422
- env:
3523
- BUILD_TASK=test
3624
- TAG=3.3.0-contrib
37-
- env:
38-
- BUILD_TASK=test
39-
- TAG=3.4.0
4025
- env:
4126
- BUILD_TASK=cover
4227
- TAG=3.4.0-contrib
@@ -45,10 +30,16 @@ matrix:
4530
- TAG=3.4.0-contrib-world
4631
- env:
4732
- BUILD_TASK=test
48-
- TAG=3.4.1
33+
- TAG=3.4.1-contrib
4934
- env:
5035
- BUILD_TASK=test
51-
- TAG=3.4.1-contrib
36+
- TAG=3.4.2-contrib
37+
- env:
38+
- BUILD_TASK=test
39+
- TAG=3.4.3
40+
- env:
41+
- BUILD_TASK=test
42+
- TAG=3.4.3-contrib
5243

5344
before_install:
5445
- chmod +x ./ci/$BUILD_TASK/$BUILD_TASK.sh

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ Or simply pull from [justadudewhohacks/opencv-nodejs](https://hub.docker.com/r/j
141141
FROM justadudewhohacks/opencv-nodejs
142142
```
143143

144+
**Note**: The aforementioned Docker image already has ```opencv4nodejs``` installed globally. In order to prevent build errors during an ```npm install```, your ```package.json``` should not include ```opencv4nodejs```, and instead should include/require the global package either by requiring it by absolute path or setting the ```NODE_PATH``` environment variable to ```/usr/lib/node_modules``` in your Dockerfile and requiring the package as you normally would.
145+
144146
Different OpenCV 3.x base images can be found here: https://hub.docker.com/r/justadudewhohacks/.
145147

146148
<a name="usage-with-electron"></a>
@@ -502,4 +504,4 @@ const cv = require('opencv4nodejs')
502504
* <a href="https://justadudewhohacks.github.io/opencv4nodejs/docs/SIFTDetector#SIFTDetector"><b>xfeatures2d</b></a>
503505
* <a href="https://justadudewhohacks.github.io/opencv4nodejs/docs/MultiTracker#MultiTracker"><b>tracking</b></a>
504506
* <a href="https://justadudewhohacks.github.io/opencv4nodejs/docs/OCRHMMClassifier#OCRHMMClassifier"><b>text</b></a>
505-
* <a href="https://justadudewhohacks.github.io/opencv4nodejs/docs/EigenFaceRecognizer#EigenFaceRecognizer"><b>face</b></a>
507+
* <a href="https://justadudewhohacks.github.io/opencv4nodejs/docs/EigenFaceRecognizer#EigenFaceRecognizer"><b>face</b></a>

cc/core/Mat.cc

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ NAN_MODULE_INIT(Mat::Init) {
2828
Nan::SetPrototypeMethod(ctor, "at", At);
2929
Nan::SetPrototypeMethod(ctor, "atRaw", AtRaw);
3030
Nan::SetPrototypeMethod(ctor, "set", Set);
31+
Nan::SetPrototypeMethod(ctor, "setTo", SetTo);
32+
Nan::SetPrototypeMethod(ctor, "setToAsync", SetToAsync);
3133
Nan::SetPrototypeMethod(ctor, "push_back", PushBack);
3234
Nan::SetPrototypeMethod(ctor, "push_backAsync", PushBackAsync);
3335
Nan::SetPrototypeMethod(ctor, "pushBack", PushBack);
@@ -91,6 +93,8 @@ NAN_MODULE_INIT(Mat::Init) {
9193
Nan::SetPrototypeMethod(ctor, "meanStdDevAsync", MeanStdDevAsync);
9294
Nan::SetPrototypeMethod(ctor, "copyMakeBorder", CopyMakeBorder);
9395
Nan::SetPrototypeMethod(ctor, "copyMakeBorderAsync", CopyMakeBorderAsync);
96+
Nan::SetPrototypeMethod(ctor, "reduce", Reduce);
97+
Nan::SetPrototypeMethod(ctor, "reduceAsync", ReduceAsync);
9498
#if CV_VERSION_MINOR > 1
9599
Nan::SetPrototypeMethod(ctor, "rotate", Rotate);
96100
Nan::SetPrototypeMethod(ctor, "rotateAsync", RotateAsync);
@@ -191,7 +195,7 @@ NAN_METHOD(Mat::New) {
191195
self->setNativeProps(mat);
192196
}
193197
self->Wrap(info.Holder());
194-
198+
195199
// if ExternalMemTracking is disabled, the following instruction will be a no op
196200
// notes: I *think* New should be called in JS thread where cv::mat has been created async,
197201
// so a good place to rationalise memory
@@ -293,6 +297,22 @@ NAN_METHOD(Mat::Set) {
293297
}
294298
}
295299

300+
NAN_METHOD(Mat::SetTo) {
301+
FF::SyncBinding(
302+
std::make_shared<MatBindings::SetToWorker>(Mat::Converter::unwrap(info.This())),
303+
"Mat::SetTo",
304+
info
305+
);
306+
}
307+
308+
NAN_METHOD(Mat::SetToAsync) {
309+
FF::AsyncBinding(
310+
std::make_shared<MatBindings::SetToWorker>(Mat::Converter::unwrap(info.This())),
311+
"Mat::SetToAsync",
312+
info
313+
);
314+
}
315+
296316
NAN_METHOD(Mat::GetDataAsArray) {
297317
cv::Mat mat = FF_UNWRAP_MAT_AND_GET(info.This());
298318
FF_ARR rowArray = FF_NEW_ARRAY(mat.size[0]);
@@ -355,9 +375,9 @@ NAN_METHOD(Mat::Normalize) {
355375
if (!hasOptArgsObj) {
356376
FF_ARG_NUMBER_IFDEF(0, alpha, 1.0);
357377
FF_ARG_NUMBER_IFDEF(1, beta, 0.0);
358-
FF_ARG_UINT_IFDEF(3, normType, normType);
359-
FF_ARG_INT_IFDEF(4, dtype, dtype);
360-
FF_ARG_INSTANCE_IFDEF(5, mask, Mat::constructor, FF_UNWRAP_MAT_AND_GET, mask);
378+
FF_ARG_UINT_IFDEF(2, normType, normType);
379+
FF_ARG_INT_IFDEF(3, dtype, dtype);
380+
FF_ARG_INSTANCE_IFDEF(4, mask, Mat::constructor, FF_UNWRAP_MAT_AND_GET, mask);
361381
}
362382

363383
FF_OBJ jsMat = FF_NEW_INSTANCE(constructor);
@@ -823,6 +843,22 @@ NAN_METHOD(Mat::CopyMakeBorderAsync) {
823843
);
824844
}
825845

846+
NAN_METHOD(Mat::Reduce) {
847+
FF::SyncBinding(
848+
std::make_shared<MatBindings::ReduceWorker>(Mat::Converter::unwrap(info.This())),
849+
"Mat::Reduce",
850+
info
851+
);
852+
}
853+
854+
NAN_METHOD(Mat::ReduceAsync) {
855+
FF::AsyncBinding(
856+
std::make_shared<MatBindings::ReduceWorker>(Mat::Converter::unwrap(info.This())),
857+
"Mat::ReduceAsync",
858+
info
859+
);
860+
}
861+
826862
#if CV_VERSION_MINOR > 1
827863
NAN_METHOD(Mat::Rotate) {
828864
FF::SyncBinding(
@@ -839,4 +875,4 @@ NAN_METHOD(Mat::RotateAsync) {
839875
info
840876
);
841877
}
842-
#endif
878+
#endif

cc/core/Mat.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class Mat : public Nan::ObjectWrap {
6464
static NAN_METHOD(At);
6565
static NAN_METHOD(AtRaw);
6666
static NAN_METHOD(Set);
67+
static NAN_METHOD(SetTo);
68+
static NAN_METHOD(SetToAsync);
6769
static NAN_METHOD(GetDataAsArray);
6870
static NAN_METHOD(GetRegion);
6971
static NAN_METHOD(Norm);
@@ -122,11 +124,13 @@ class Mat : public Nan::ObjectWrap {
122124
static NAN_METHOD(MeanStdDevAsync);
123125
static NAN_METHOD(CopyMakeBorder);
124126
static NAN_METHOD(CopyMakeBorderAsync);
127+
static NAN_METHOD(Reduce);
128+
static NAN_METHOD(ReduceAsync);
125129
#if CV_VERSION_MINOR > 1
126130
static NAN_METHOD(Rotate);
127131
static NAN_METHOD(RotateAsync);
128132
#endif
129133

130134
};
131135

132-
#endif
136+
#endif

0 commit comments

Comments
 (0)