mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
cleanup - use new includes only if CV major version code is >= 3.
This commit is contained in:
parent
2931440acb
commit
ccf152d595
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
#include "OpenCV.h"
|
#include "OpenCV.h"
|
||||||
|
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/calib3d.hpp>
|
#include <opencv2/calib3d.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Implementation of calib3d.hpp functions
|
// Implementation of calib3d.hpp functions
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,9 @@
|
|||||||
#include "OpenCV.h"
|
#include "OpenCV.h"
|
||||||
#include "Matrix.h"
|
#include "Matrix.h"
|
||||||
|
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/video/tracking.hpp>
|
#include <opencv2/video/tracking.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHANNEL_HUE 0
|
#define CHANNEL_HUE 0
|
||||||
#define CHANNEL_SATURATION 1
|
#define CHANNEL_SATURATION 1
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
#include "Matrix.h"
|
#include "Matrix.h"
|
||||||
#include <nan.h>
|
#include <nan.h>
|
||||||
|
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/objdetect.hpp>
|
#include <opencv2/objdetect.hpp>
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#include <opencv2/imgcodecs.hpp>
|
#include <opencv2/imgcodecs.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
Persistent<FunctionTemplate> CascadeClassifierWrap::constructor;
|
Persistent<FunctionTemplate> CascadeClassifierWrap::constructor;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include "OpenCV.h"
|
#include "OpenCV.h"
|
||||||
|
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/objdetect.hpp>
|
#include <opencv2/objdetect.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
class CascadeClassifierWrap: public node::ObjectWrap {
|
class CascadeClassifierWrap: public node::ObjectWrap {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <opencv2/imgproc.hpp>
|
|
||||||
|
|
||||||
v8::Persistent<FunctionTemplate> Contour::constructor;
|
v8::Persistent<FunctionTemplate> Contour::constructor;
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
#include "OpenCV.h"
|
#include "OpenCV.h"
|
||||||
#include <nan.h>
|
#include <nan.h>
|
||||||
|
|
||||||
#include <opencv2/core.hpp>
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/imgproc.hpp>
|
|
||||||
#include <opencv2/imgcodecs.hpp>
|
#include <opencv2/imgcodecs.hpp>
|
||||||
#include <opencv2/ml.hpp>
|
#include <opencv2/ml.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
v8::Persistent<FunctionTemplate> Matrix::constructor;
|
v8::Persistent<FunctionTemplate> Matrix::constructor;
|
||||||
|
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
#include "Matrix.h"
|
#include "Matrix.h"
|
||||||
#include <nan.h>
|
#include <nan.h>
|
||||||
|
|
||||||
#include <opencv2/core.hpp>
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/imgcodecs.hpp>
|
#include <opencv2/imgcodecs.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
OpenCV::Init(Handle<Object> target) {
|
OpenCV::Init(Handle<Object> target) {
|
||||||
|
|||||||
@ -7,9 +7,11 @@
|
|||||||
#include <node_version.h>
|
#include <node_version.h>
|
||||||
#include <node_buffer.h>
|
#include <node_buffer.h>
|
||||||
#include <opencv/cv.h>
|
#include <opencv/cv.h>
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
#include <opencv2/highgui.hpp>
|
#include <opencv2/highgui.hpp>
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#include <opencv2/videoio.hpp>
|
#include <opencv2/videoio.hpp>
|
||||||
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <nan.h>
|
#include <nan.h>
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
#include "Stereo.h"
|
#include "Stereo.h"
|
||||||
#include "Matrix.h"
|
#include "Matrix.h"
|
||||||
//#include <opencv2/legacy.hpp>
|
#if CV_MAJOR_VERSION < 3
|
||||||
#include <opencv2/ml.hpp>
|
#include <opencv2/legacy.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
|
#include <opencv2/ml.hpp>
|
||||||
|
#endif
|
||||||
// Block matching
|
// Block matching
|
||||||
|
|
||||||
v8::Persistent<FunctionTemplate> StereoBM::constructor;
|
v8::Persistent<FunctionTemplate> StereoBM::constructor;
|
||||||
@ -17,11 +21,11 @@ StereoBM::Init(Handle<Object> target) {
|
|||||||
ctor->SetClassName(NanNew("StereoBM"));
|
ctor->SetClassName(NanNew("StereoBM"));
|
||||||
|
|
||||||
NODE_SET_PROTOTYPE_METHOD(ctor, "compute", Compute);
|
NODE_SET_PROTOTYPE_METHOD(ctor, "compute", Compute);
|
||||||
|
#if CV_MAJOR_VERSION < 3
|
||||||
ctor->Set(NanNew<String>("BASIC_PRESET"), NanNew<Integer>((int)0));
|
ctor->Set(NanNew<String>("BASIC_PRESET"), NanNew<Integer>((int)cv::StereoBM::BASIC_PRESET));
|
||||||
ctor->Set(NanNew<String>("FISH_EYE_PRESET"), NanNew<Integer>((int)1));
|
ctor->Set(NanNew<String>("FISH_EYE_PRESET"), NanNew<Integer>((int)cv::StereoBM::FISH_EYE_PRESET));
|
||||||
ctor->Set(NanNew<String>("NARROW_PRESET"), NanNew<Integer>((int)2));
|
ctor->Set(NanNew<String>("NARROW_PRESET"), NanNew<Integer>((int)cv::StereoBM::NARROW_PRESET));
|
||||||
|
#endif
|
||||||
target->Set(NanNew("StereoBM"), ctor->GetFunction());
|
target->Set(NanNew("StereoBM"), ctor->GetFunction());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +233,7 @@ NAN_METHOD(StereoSGBM::Compute)
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
#if 0
|
#if CV_VERSION_MAJOR < 3
|
||||||
// Graph cut
|
// Graph cut
|
||||||
|
|
||||||
v8::Persistent<FunctionTemplate> StereoGC::constructor;
|
v8::Persistent<FunctionTemplate> StereoGC::constructor;
|
||||||
|
|||||||
@ -40,7 +40,9 @@ public:
|
|||||||
|
|
||||||
JSFUNC(Compute);
|
JSFUNC(Compute);
|
||||||
};
|
};
|
||||||
#if 0
|
|
||||||
|
#if CV_VERSION_MAJOR < 3
|
||||||
|
|
||||||
struct CvStereoGCState;
|
struct CvStereoGCState;
|
||||||
|
|
||||||
class StereoGC: public node::ObjectWrap {
|
class StereoGC: public node::ObjectWrap {
|
||||||
|
|||||||
@ -31,8 +31,9 @@ init(Handle<Object> target) {
|
|||||||
ImgProc::Init(target);
|
ImgProc::Init(target);
|
||||||
StereoBM::Init(target);
|
StereoBM::Init(target);
|
||||||
StereoSGBM::Init(target);
|
StereoSGBM::Init(target);
|
||||||
//StereoGC::Init(target);
|
#if CV_MAJOR_VERSION < 3
|
||||||
|
StereoGC::Init(target);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CV_MAJOR_VERSION >= 2 && CV_MINOR_VERSION >=4
|
#if CV_MAJOR_VERSION >= 2 && CV_MINOR_VERSION >=4
|
||||||
Features::Init(target);
|
Features::Init(target);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user