Skip to content

Commit 407c787

Browse files
committed
Fix #750 making it compatible with Opencv4.4
1 parent f6eacac commit 407c787

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
- OPENCV4NODEJS_DISABLE_AUTOBUILD=1
1111
- LATEST_STABLE_NODEJS_VERSION=12
1212
- OPENCV3_LATEST=3.4.6
13-
- OPENCV4_LATEST=4.1.0
13+
- OPENCV4_LATEST=4.4.0
1414

1515
matrix:
1616
include:

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ init:
1515
# what combinations to test
1616
environment:
1717
OPENCV3_LATEST: 3.4.6
18-
OPENCV4_LATEST: 4.1.0
18+
OPENCV4_LATEST: 4.4.0
1919
PYTHON_VERSION: 2.7
2020
PYTHON: "C:\\Python27-x64"
2121
# use self build
@@ -28,6 +28,9 @@ environment:
2828
- nodejs_version: 12
2929
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
3030
OPENCV_VERSION: "%OPENCV3_LATEST%"
31+
- nodejs_version: 12
32+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
33+
OPENCV_VERSION: 4.1.0
3134
- nodejs_version: 12
3235
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
3336
OPENCV_VERSION: "%OPENCV4_LATEST%"

cc/xfeatures2d/SIFTDetector.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
#ifndef __FF_SIFTDETECTOR_H__
77
#define __FF_SIFTDETECTOR_H__
88

9+
#if CV_VERSION_GREATER_EQUAL(4, 4, 0)
10+
class SIFTDetector : public FeatureDetector, public FF::ObjectWrapTemplate<SIFTDetector, cv::Ptr<cv::SIFT>> {
11+
#else
912
class SIFTDetector : public FeatureDetector, public FF::ObjectWrapTemplate<SIFTDetector, cv::Ptr<cv::xfeatures2d::SIFT>> {
13+
#endif
1014
public:
1115
static Nan::Persistent<v8::FunctionTemplate> constructor;
1216

@@ -47,7 +51,11 @@ class SIFTDetector : public FeatureDetector, public FF::ObjectWrapTemplate<SIFTD
4751
auto sigma = opt<FF::DoubleConverter>("sigma", 1.6);
4852

4953
executeBinding = [=]() {
54+
#if CV_VERSION_GREATER_EQUAL(4, 4, 0)
55+
return cv::SIFT::create(
56+
#else
5057
return cv::xfeatures2d::SIFT::create(
58+
#endif
5159
nFeatures->ref(),
5260
nOctaveLayers->ref(),
5361
contrastThreshold->ref(),
@@ -67,4 +75,4 @@ class SIFTDetector : public FeatureDetector, public FF::ObjectWrapTemplate<SIFTD
6775
};
6876
};
6977

70-
#endif
78+
#endif

0 commit comments

Comments
 (0)