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

Commit 8580f17

Browse files
committed
add TrackerCSRT
1 parent a940aa3 commit 8580f17

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#ifdef HAVE_TRACKING
2+
3+
#include "TrackerCSRT.h"
4+
#include "TrackerCSRTParams.h"
5+
6+
#if CV_MINOR_VERSION > 3
7+
8+
Nan::Persistent<v8::FunctionTemplate> TrackerCSRT::constructor;
9+
10+
NAN_MODULE_INIT(TrackerCSRT::Init) {
11+
v8::Local<v8::FunctionTemplate> ctor = Nan::New<v8::FunctionTemplate>(TrackerCSRT::New);
12+
v8::Local<v8::ObjectTemplate> instanceTemplate = ctor->InstanceTemplate();
13+
14+
Tracker::Init(ctor);
15+
TrackerCSRTParams::Init(target);
16+
17+
constructor.Reset(ctor);
18+
ctor->SetClassName(FF_NEW_STRING("TrackerCSRT"));
19+
instanceTemplate->SetInternalFieldCount(1);
20+
21+
target->Set(FF_NEW_STRING("TrackerCSRT"), ctor->GetFunction());
22+
};
23+
24+
25+
NAN_METHOD(TrackerCSRT::New) {
26+
FF_ASSERT_CONSTRUCT_CALL(TrackerCSRT);
27+
FF_METHOD_CONTEXT("TrackerCSRT::New");
28+
29+
FF_ARG_INSTANCE_IFDEF(
30+
0,
31+
cv::TrackerCSRT::Params params,
32+
TrackerCSRTParams::constructor,
33+
FF_UNWRAP_TRACKERCSRTPARAMS_AND_GET,
34+
cv::TrackerCSRT::Params()
35+
);
36+
37+
TrackerCSRT* self = new TrackerCSRT();
38+
self->tracker = cv::TrackerCSRT::create(params);
39+
self->Wrap(info.Holder());
40+
FF_RETURN(info.Holder());
41+
};
42+
43+
#endif
44+
45+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "../Tracker.h"
2+
3+
#if CV_MINOR_VERSION > 3
4+
5+
#ifndef __FF_TRACKERCSRT_H__
6+
#define __FF_TRACKERCSRT_H__
7+
8+
class TrackerCSRT : public Tracker {
9+
public:
10+
cv::Ptr<cv::TrackerCSRT> tracker;
11+
12+
static NAN_MODULE_INIT(Init);
13+
static NAN_METHOD(New);
14+
15+
static Nan::Persistent<v8::FunctionTemplate> constructor;
16+
17+
cv::Ptr<cv::Tracker> getTracker() {
18+
return tracker;
19+
}
20+
};
21+
22+
#endif
23+
24+
#endif

0 commit comments

Comments
 (0)