Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrackerNano implementation #165

Merged
merged 13 commits into from
Sep 26, 2024
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![NPM Version](https://img.shields.io/npm/v/@u4/opencv4nodejs.svg?style=flat)](https://www.npmjs.org/package/@u4/opencv4nodejs)

## Getting starts
## Getting started

Opencv4nodejs can be linked to a prebuild openCV 3 or 4. or can build its own openCV using [@u4/opencv-build](https://www.npmjs.com/package/@u4/opencv-build),
In this case, you have to choose which version you want to link.
Expand Down
1 change: 1 addition & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"cc/tracking/Trackers/TrackerMedianFlow.cc",
"cc/tracking/Trackers/TrackerTLD.cc",
"cc/tracking/Trackers/TrackerGOTURN.cc",
"cc/tracking/Trackers/TrackerNano.cc",
"cc/tracking/Trackers/TrackerCSRT.cc",
"cc/tracking/Trackers/TrackerCSRTParams.cc",
"cc/tracking/Trackers/TrackerMOSSE.cc",
Expand Down
1 change: 1 addition & 0 deletions binding_old.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"cc/tracking/Trackers/TrackerMedianFlow.cc",
"cc/tracking/Trackers/TrackerTLD.cc",
"cc/tracking/Trackers/TrackerGOTURN.cc",
"cc/tracking/Trackers/TrackerNano.cc",
"cc/tracking/Trackers/TrackerCSRT.cc",
"cc/tracking/Trackers/TrackerCSRTParams.cc",
"cc/tracking/Trackers/TrackerMOSSE.cc",
Expand Down
117 changes: 117 additions & 0 deletions cc/tracking/Trackers/TrackerNano.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#include "opencv_modules.h"

#ifdef HAVE_OPENCV_TRACKING

#include "TrackerNano.h"

#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think the min value for the NanoTracker is 4.7.0


Nan::Persistent<v8::FunctionTemplate> TrackerNano::constructor;

#if CV_VERSION_GREATER_EQUAL(4, 5, 2)

NAN_METHOD(TrackerNano::Clear) {
}

NAN_METHOD(TrackerNano::Init) {
FF::TryCatch tryCatch("TrackerNano::Init");
cv::Mat image;
cv::Rect2d boundingBox;
if (
Mat::Converter::arg(0, &image, info) || Rect::Converter::arg(1, &boundingBox, info)) {
return tryCatch.reThrow();
}

TrackerNano::unwrapThis(info)->getTracker()->init(image, boundingBox);
}

NAN_METHOD(TrackerNano::Update) {
FF::TryCatch tryCatch("TrackerNano::Update");
cv::Mat image;
if (Mat::Converter::arg(0, &image, info)) {
return tryCatch.reThrow();
}

cv::Rect rect;
bool ret = false;

try {
ret = TrackerNano::unwrapThis(info)->getTracker()->update(image, rect);
} catch (std::exception& e) {
return tryCatch.throwError(e.what());
}

if (ret) {
info.GetReturnValue().Set(Rect::Converter::wrap(rect));
} else {
info.GetReturnValue().Set(Nan::Null());
}
}

NAN_METHOD(TrackerNano::GetModel) {
// TBD
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBD ???

}

#endif

NAN_MODULE_INIT(TrackerNano::Init) {
v8::Local<v8::FunctionTemplate> ctor = Nan::New<v8::FunctionTemplate>(TrackerNano::New);
v8::Local<v8::ObjectTemplate> instanceTemplate = ctor->InstanceTemplate();

#if CV_VERSION_GREATER_EQUAL(4, 5, 2)
Nan::SetPrototypeMethod(ctor, "clear", TrackerNano::Clear);
Nan::SetPrototypeMethod(ctor, "init", TrackerNano::Init);
Nan::SetPrototypeMethod(ctor, "update", TrackerNano::Update);
Nan::SetPrototypeMethod(ctor, "getModel", TrackerNano::GetModel);
#else
Tracker::Init(ctor);
#endif
constructor.Reset(ctor);
ctor->SetClassName(FF::newString("TrackerNano"));
instanceTemplate->SetInternalFieldCount(1);

Nan::Set(target, FF::newString("TrackerNano"), FF::getFunction(ctor));
};

NAN_METHOD(TrackerNano::New) {
FF::TryCatch tryCatch("TrackerNano::New");
FF_ASSERT_CONSTRUCT_CALL();

// Default model paths
std::string backboneModelPath = "backbone.onnx";
std::string neckheadModelPath = "neckhead.onnx";

// Check if the user passed model paths as arguments
if (info.Length() > 0) {
if (FF::StringConverter::arg(0, &backboneModelPath, info)) {
return tryCatch.reThrow();
}
}

if (info.Length() > 1) {
if (FF::StringConverter::arg(1, &neckheadModelPath, info)) {
return tryCatch.reThrow();
}
}

// Initialize TrackerNano with provided or default models
TrackerNano* self = new TrackerNano();
#if CV_VERSION_GREATER_EQUAL(3, 3, 0)
// Create tracker with provided ONNX models
cv::TrackerNano::Params params;
params.backbone = backboneModelPath; // Setting the backbone model from argument or default
params.neckhead = neckheadModelPath; // Setting the neck-head model from argument or default

// Create the tracker instance with these parameters
self->tracker = cv::TrackerNano::create(params);
#else
self->tracker = cv::TrackerNano::createTracker();
#endif

self->Wrap(info.Holder());
info.GetReturnValue().Set(info.Holder());
}

#endif

#endif
33 changes: 33 additions & 0 deletions cc/tracking/Trackers/TrackerNano.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "../Tracker.h"

#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
figamore marked this conversation as resolved.
Show resolved Hide resolved

#ifndef __FF_TRACKERNANO_H__
#define __FF_TRACKERNANO_H__

#if CV_VERSION_GREATER_EQUAL(4, 5, 2)
class TrackerNano : public FF::ObjectWrapBase<TrackerNano>, public Nan::ObjectWrap {
#else
class TrackerNano : public Tracker {
#endif
public:
cv::Ptr<cv::TrackerNano> tracker;

static NAN_MODULE_INIT(Init);
static NAN_METHOD(New); // The New method can accept model paths as parameters
#if CV_VERSION_GREATER_EQUAL(4, 5, 2)
static NAN_METHOD(Clear);
static NAN_METHOD(Init);
static NAN_METHOD(Update);
static NAN_METHOD(GetModel);
#endif
static Nan::Persistent<v8::FunctionTemplate> constructor;

cv::Ptr<cv::Tracker> getTracker() {
return tracker;
}
};

#endif

#endif
2 changes: 2 additions & 0 deletions cc/tracking/tracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
#include "./Trackers/TrackerGOTURN.h"
#include "./Trackers/TrackerNano.h"
#endif

#if CV_VERSION_GREATER_EQUAL(3, 4, 0)
Expand Down Expand Up @@ -42,6 +43,7 @@ NAN_MODULE_INIT(Tracking::Init) {

#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
TrackerGOTURN::Init(target);
TrackerNano::Init(target);
#endif

#if CV_VERSION_GREATER_EQUAL(3, 4, 0)
Expand Down
5 changes: 3 additions & 2 deletions cjs/lib/opencv4nodejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.goodFeaturesToTrack = exports.cannyAsync = exports.canny = exports.apply
exports.CAP_PROP_ISO_SPEED = exports.CAP_PROP_GUID = exports.CAP_PROP_FOCUS = exports.CAP_PROP_ZOOM = exports.CAP_PROP_WHITE_BALANCE_RED_V = exports.CAP_PROP_TRIGGER_DELAY = exports.CAP_PROP_TRIGGER = exports.CAP_PROP_TEMPERATURE = exports.CAP_PROP_GAMMA = exports.CAP_PROP_AUTO_EXPOSURE = exports.CAP_PROP_SHARPNESS = exports.CAP_PROP_MONOCHROME = exports.CAP_PROP_RECTIFICATION = exports.CAP_PROP_WHITE_BALANCE_BLUE_U = exports.CAP_PROP_CONVERT_RGB = exports.CAP_PROP_EXPOSURE = exports.CAP_PROP_GAIN = exports.CAP_PROP_HUE = exports.CAP_PROP_SATURATION = exports.CAP_PROP_CONTRAST = exports.CAP_PROP_BRIGHTNESS = exports.CAP_PROP_MODE = exports.CAP_PROP_FORMAT = exports.CAP_PROP_FRAME_COUNT = exports.CAP_PROP_FOURCC = exports.CAP_PROP_FPS = exports.CAP_PROP_FRAME_HEIGHT = exports.CAP_PROP_FRAME_WIDTH = exports.CAP_PROP_POS_AVI_RATIO = exports.CAP_PROP_POS_FRAMES = exports.CAP_PROP_POS_MSEC = exports.Contour = exports.Moments = exports.calcHistAsync = exports.calcHist = exports.accumulateWeightedAsync = exports.accumulateWeighted = exports.accumulateSquareAsync = exports.accumulateSquare = exports.accumulateProductAsync = exports.accumulateProduct = exports.accumulateAsync = exports.accumulate = exports.medianBlurAsync = exports.medianBlur = exports.gaussianBlurAsync = exports.gaussianBlur = exports.blurAsync = exports.blur = exports.goodFeaturesToTrackAsync = void 0;
exports.destroyWindow = exports.imdecode = exports.imencode = exports.waitKeyEx = exports.waitKey = exports.imwrite = exports.imshowWait = exports.imshow = exports.imread = exports.VideoWriter = exports.VideoCapture = exports.VIDEOWRITER_PROP_NSTRIPES = exports.VIDEOWRITER_PROP_FRAMEBYTES = exports.VIDEOWRITER_PROP_QUALITY = exports.CAP_ARAVIS = exports.CAP_IMAGES = exports.CAP_FFMPEG = exports.CAP_GSTREAMER = exports.CAP_GPHOTO2 = exports.CAP_OPENNI2_ASUS = exports.CAP_OPENNI2 = exports.CAP_INTELPERC = exports.CAP_WINRT = exports.CAP_MSMF = exports.CAP_GIGANETIX = exports.CAP_AVFOUNDATION = exports.CAP_XIAPI = exports.CAP_ANDROID = exports.CAP_OPENNI_ASUS = exports.CAP_OPENNI = exports.CAP_PVAPI = exports.CAP_DSHOW = exports.CAP_UNICAP = exports.CAP_QT = exports.CAP_CMU1394 = exports.CAP_DC1394 = exports.CAP_IEEE1394 = exports.CAP_FIREWIRE = exports.CAP_V4L2 = exports.CAP_V4L = exports.CAP_VFW = exports.CAP_ANY = exports.CAP_PROP_AUTOFOCUS = exports.CAP_PROP_BUFFERSIZE = exports.CAP_PROP_SETTINGS = exports.CAP_PROP_IRIS = exports.CAP_PROP_ROLL = exports.CAP_PROP_TILT = exports.CAP_PROP_PAN = exports.CAP_PROP_BACKLIGHT = void 0;
exports.HOGHistogramNormType = exports.HOGDescriptor = exports.CascadeClassifier = exports.SVM = exports.StatModel = exports.ParamGrid = exports.TrainData = exports.statModel = exports.ml = exports.IMWRITE_PNG_STRATEGY_FIXED = exports.IMWRITE_PNG_STRATEGY_RLE = exports.IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY = exports.IMWRITE_PNG_STRATEGY_FILTERED = exports.IMWRITE_PNG_STRATEGY_DEFAULT = exports.IMWRITE_PAM_FORMAT_RGB_ALPHA = exports.IMWRITE_PAM_FORMAT_RGB = exports.IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = exports.IMWRITE_PAM_FORMAT_GRAYSCALE = exports.IMWRITE_PAM_FORMAT_BLACKANDWHITE = exports.IMWRITE_PAM_FORMAT_NULL = exports.IMWRITE_PAM_TUPLETYPE = exports.IMREAD_IGNORE_ORIENTATION = exports.IMREAD_REDUCED_COLOR_8 = exports.IMREAD_REDUCED_GRAYSCALE_8 = exports.IMREAD_REDUCED_COLOR_4 = exports.IMREAD_REDUCED_GRAYSCALE_4 = exports.IMREAD_REDUCED_COLOR_2 = exports.IMREAD_REDUCED_GRAYSCALE_2 = exports.IMWRITE_WEBP_QUALITY = exports.IMWRITE_PXM_BINARY = exports.IMWRITE_PNG_BILEVEL = exports.IMWRITE_PNG_STRATEGY = exports.IMWRITE_PNG_COMPRESSION = exports.IMWRITE_JPEG_CHROMA_QUALITY = exports.IMWRITE_JPEG_LUMA_QUALITY = exports.IMWRITE_JPEG_RST_INTERVAL = exports.IMWRITE_JPEG_OPTIMIZE = exports.IMWRITE_JPEG_PROGRESSIVE = exports.IMWRITE_JPEG_QUALITY = exports.IMREAD_LOAD_GDAL = exports.IMREAD_ANYCOLOR = exports.IMREAD_ANYDEPTH = exports.IMREAD_COLOR = exports.IMREAD_GRAYSCALE = exports.IMREAD_UNCHANGED = exports.imdecodeAsync = exports.imencodeAsync = exports.imwriteAsync = exports.imreadAsync = exports.destroyAllWindows = void 0;
exports.HAAR_FRONTALFACE_ALT2 = exports.HAAR_FRONTALFACE_ALT = exports.HAAR_FRONTALCATFACE_EXTENDED = exports.HAAR_FRONTALCATFACE = exports.HAAR_EYE_TREE_EYEGLASSES = exports.HAAR_EYE = exports.PHash = exports.SLICO = exports.SLIC = exports.SuperpixelLSC = exports.SuperpixelSLIC = exports.SuperpixelSEEDS = exports.SURFDetector = exports.SIFTDetector = exports.BackgroundSubtractorKNN = exports.BackgroundSubtractorMOG2 = exports.TrackerCSRT = exports.TrackerCSRTParams = exports.TrackerMOSSE = exports.TrackerGOTURN = exports.trackerKCFModes = exports.MultiTracker = exports.TrackerKCF = exports.TrackerKCFParams = exports.TrackerTLD = exports.TrackerMIL = exports.TrackerMILParams = exports.TrackerMedianFlow = exports.TrackerBoosting = exports.TrackerBoostingParams = exports.createOCRHMMTransitionsTableAsync = exports.createOCRHMMTransitionsTable = exports.loadOCRHMMClassifierCNNAsync = exports.loadOCRHMMClassifierCNN = exports.loadOCRHMMClassifierNMAsync = exports.loadOCRHMMClassifierNM = exports.OCRHMMClassifier = exports.OCRHMMDecoder = exports.seamlessCloneAsync = exports.seamlessClone = exports.inpaintAsync = exports.inpaint = exports.fastNlMeansDenoisingColoredAsync = exports.fastNlMeansDenoisingColored = exports.MONOCHROME_TRANSFER = exports.MIXED_CLONE = exports.NORMAL_CLONE = exports.INPAINT_TELEA = exports.INPAINT_NS = exports.DetectionROI = void 0;
exports.HAAR_FRONTALFACE_ALT2 = exports.HAAR_FRONTALFACE_ALT = exports.HAAR_FRONTALCATFACE_EXTENDED = exports.HAAR_FRONTALCATFACE = exports.HAAR_EYE_TREE_EYEGLASSES = exports.HAAR_EYE = exports.PHash = exports.SLICO = exports.SLIC = exports.SuperpixelLSC = exports.SuperpixelSLIC = exports.SuperpixelSEEDS = exports.SURFDetector = exports.SIFTDetector = exports.BackgroundSubtractorKNN = exports.BackgroundSubtractorMOG2 = exports.TrackerCSRT = exports.TrackerCSRTParams = exports.TrackerMOSSE = exports.TrackerGOTURN = exports.TrackerNano = exports.trackerKCFModes = exports.MultiTracker = exports.TrackerKCF = exports.TrackerKCFParams = exports.TrackerTLD = exports.TrackerMIL = exports.TrackerMILParams = exports.TrackerMedianFlow = exports.TrackerBoosting = exports.TrackerBoostingParams = exports.createOCRHMMTransitionsTableAsync = exports.createOCRHMMTransitionsTable = exports.loadOCRHMMClassifierCNNAsync = exports.loadOCRHMMClassifierCNN = exports.loadOCRHMMClassifierNMAsync = exports.loadOCRHMMClassifierNM = exports.OCRHMMClassifier = exports.OCRHMMDecoder = exports.seamlessCloneAsync = exports.seamlessClone = exports.inpaintAsync = exports.inpaint = exports.fastNlMeansDenoisingColoredAsync = exports.fastNlMeansDenoisingColored = exports.MONOCHROME_TRANSFER = exports.MIXED_CLONE = exports.NORMAL_CLONE = exports.INPAINT_TELEA = exports.INPAINT_NS = exports.DetectionROI = void 0;
exports.ORB = exports.FAST = exports.KAZE = exports.AKAZE = exports.AGAST = exports.dropOverlappingZone = exports.getScoreMax = exports.toMatTypeName = exports.getVersionString = exports.getVersion = exports.drawDetection = exports.drawTextBox = exports.LBP_SILVERWARE = exports.LBP_PROFILEFACE = exports.LBP_FRONTALFACE_IMPROVED = exports.LBP_FRONTALFACE = exports.LBP_FRONTALCATFACE = exports.HAAR_UPPERBODY = exports.HAAR_SMILE = exports.HAAR_RUSSIAN_PLATE_NUMBER = exports.HAAR_RIGHTEYE_2SPLITS = exports.HAAR_PROFILEFACE = exports.HAAR_LOWERBODY = exports.HAAR_LICENCE_PLATE_RUS_16STAGES = exports.HAAR_LEFTEYE_2SPLITS = exports.HAAR_FULLBODY = exports.HAAR_FRONTALFACE_DEFAULT = exports.HAAR_FRONTALFACE_ALT_TREE = void 0;
const node_path_1 = __importDefault(require("node:path"));
const promisify_js_1 = __importDefault(require("./promisify.js"));
Expand Down Expand Up @@ -998,7 +998,7 @@ exports.createOCRHMMTransitionsTableAsync = createOCRHMMTransitionsTableAsync;
exports.TrackerBoostingParams = TrackerBoostingParams;
exports.TrackerBoosting = TrackerBoosting;
exports.TrackerMedianFlow = TrackerMedianFlow;
const { TrackerMILParams, TrackerMIL, TrackerTLD, TrackerKCFParams, TrackerKCF, MultiTracker, trackerKCFModes, TrackerGOTURN, TrackerMOSSE, TrackerCSRTParams, TrackerCSRT, BackgroundSubtractorMOG2, BackgroundSubtractorKNN, SIFTDetector, SURFDetector } = exports.cv;
const { TrackerMILParams, TrackerMIL, TrackerTLD, TrackerKCFParams, TrackerKCF, MultiTracker, trackerKCFModes, TrackerGOTURN, TrackerNano, TrackerMOSSE, TrackerCSRTParams, TrackerCSRT, BackgroundSubtractorMOG2, BackgroundSubtractorKNN, SIFTDetector, SURFDetector } = exports.cv;
exports.TrackerMILParams = TrackerMILParams;
exports.TrackerMIL = TrackerMIL;
exports.TrackerTLD = TrackerTLD;
Expand All @@ -1007,6 +1007,7 @@ exports.TrackerKCF = TrackerKCF;
exports.MultiTracker = MultiTracker;
exports.trackerKCFModes = trackerKCFModes;
exports.TrackerGOTURN = TrackerGOTURN;
exports.TrackerNano = TrackerNano;
exports.TrackerMOSSE = TrackerMOSSE;
exports.TrackerCSRTParams = TrackerCSRTParams;
exports.TrackerCSRT = TrackerCSRT;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/opencv4nodejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ const { TrainData,ParamGrid,StatModel,SVM,CascadeClassifier,HOGDescriptor,HOGHis
export { TrainData,ParamGrid,StatModel,SVM,CascadeClassifier,HOGDescriptor,HOGHistogramNormType,DetectionROI,INPAINT_NS,INPAINT_TELEA,NORMAL_CLONE,MIXED_CLONE,MONOCHROME_TRANSFER,fastNlMeansDenoisingColored,fastNlMeansDenoisingColoredAsync };
const { inpaint,inpaintAsync,seamlessClone,seamlessCloneAsync,OCRHMMDecoder,OCRHMMClassifier,loadOCRHMMClassifierNM,loadOCRHMMClassifierNMAsync,loadOCRHMMClassifierCNN,loadOCRHMMClassifierCNNAsync,createOCRHMMTransitionsTable,createOCRHMMTransitionsTableAsync,TrackerBoostingParams,TrackerBoosting,TrackerMedianFlow } = cv;
export { inpaint,inpaintAsync,seamlessClone,seamlessCloneAsync,OCRHMMDecoder,OCRHMMClassifier,loadOCRHMMClassifierNM,loadOCRHMMClassifierNMAsync,loadOCRHMMClassifierCNN,loadOCRHMMClassifierCNNAsync,createOCRHMMTransitionsTable,createOCRHMMTransitionsTableAsync,TrackerBoostingParams,TrackerBoosting,TrackerMedianFlow };
const { TrackerMILParams,TrackerMIL,TrackerTLD,TrackerKCFParams,TrackerKCF,MultiTracker,trackerKCFModes,TrackerGOTURN,TrackerMOSSE,TrackerCSRTParams,TrackerCSRT,BackgroundSubtractorMOG2,BackgroundSubtractorKNN,SIFTDetector,SURFDetector } = cv;
export { TrackerMILParams,TrackerMIL,TrackerTLD,TrackerKCFParams,TrackerKCF,MultiTracker,trackerKCFModes,TrackerGOTURN,TrackerMOSSE,TrackerCSRTParams,TrackerCSRT,BackgroundSubtractorMOG2,BackgroundSubtractorKNN,SIFTDetector,SURFDetector };
const { TrackerMILParams,TrackerMIL,TrackerTLD,TrackerKCFParams,TrackerKCF,MultiTracker,trackerKCFModes,TrackerGOTURN,TrackerNano,TrackerMOSSE,TrackerCSRTParams,TrackerCSRT,BackgroundSubtractorMOG2,BackgroundSubtractorKNN,SIFTDetector,SURFDetector } = cv;
export { TrackerMILParams,TrackerMIL,TrackerTLD,TrackerKCFParams,TrackerKCF,MultiTracker,trackerKCFModes,TrackerGOTURN,TrackerNano,TrackerMOSSE,TrackerCSRTParams,TrackerCSRT,BackgroundSubtractorMOG2,BackgroundSubtractorKNN,SIFTDetector,SURFDetector };
const { SuperpixelSEEDS,SuperpixelSLIC,SuperpixelLSC,SLIC,SLICO,PHash,HAAR_EYE,HAAR_EYE_TREE_EYEGLASSES,HAAR_FRONTALCATFACE,HAAR_FRONTALCATFACE_EXTENDED,HAAR_FRONTALFACE_ALT,HAAR_FRONTALFACE_ALT2,HAAR_FRONTALFACE_ALT_TREE,HAAR_FRONTALFACE_DEFAULT,HAAR_FULLBODY } = cv;
export { SuperpixelSEEDS,SuperpixelSLIC,SuperpixelLSC,SLIC,SLICO,PHash,HAAR_EYE,HAAR_EYE_TREE_EYEGLASSES,HAAR_FRONTALCATFACE,HAAR_FRONTALCATFACE_EXTENDED,HAAR_FRONTALFACE_ALT,HAAR_FRONTALFACE_ALT2,HAAR_FRONTALFACE_ALT_TREE,HAAR_FRONTALFACE_DEFAULT,HAAR_FULLBODY };
const { HAAR_LEFTEYE_2SPLITS,HAAR_LICENCE_PLATE_RUS_16STAGES,HAAR_LOWERBODY,HAAR_PROFILEFACE,HAAR_RIGHTEYE_2SPLITS,HAAR_RUSSIAN_PLATE_NUMBER,HAAR_SMILE,HAAR_UPPERBODY,LBP_FRONTALCATFACE,LBP_FRONTALFACE,LBP_FRONTALFACE_IMPROVED,LBP_PROFILEFACE,LBP_SILVERWARE,drawTextBox,drawDetection } = cv;
Expand Down
15 changes: 15 additions & 0 deletions typings/TrackerNano.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Mat } from './Mat.d';
import { Rect } from './Rect.d';

export class TrackerNano {
/**
* Creates a new TrackerNano object.
* @param backboneModelPath Optional path to the backbone ONNX model.
* @param neckheadModelPath Optional path to the neckhead ONNX model.
*/
constructor(backboneModelPath?: string, neckheadModelPath?: string);

clear(): void;
init(frame: Mat, boundingBox: Rect): boolean;
update(frame: Mat): Rect;
}
1 change: 1 addition & 0 deletions typings/openCV.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export * from './TrackerBoostingParams';
export * from './TrackerCSRT';
export * from './TrackerCSRTParams';
export * from './TrackerGOTURN';
export * from './TrackerNano';
export * from './TrackerKCF';
export * from './TrackerKCFParams';
export * from './TrackerMIL';
Expand Down
Loading