Jetson Inference
DNN Vision Library
objectTrackerKLT.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __OBJECT_TRACKER_KLT_H__
24 #define __OBJECT_TRACKER_KLT_H__
25 
26 #ifdef HAS_VPI
27 
28 #include <vpi/Array.h>
29 #include <vpi/Image.h>
30 #include <vpi/Status.h>
31 #include <vpi/Stream.h>
32 #include <vpi/algo/KLTFeatureTracker.h>
33 
34 #include "objectTracker.h"
35 
36 
42 class objectTrackerKLT : public objectTracker
43 {
44 public:
48  static objectTrackerKLT* Create();
49 
53  static objectTrackerKLT* Create( int argc, char** argv );
54 
58  static objectTrackerKLT* Create( const commandLine& cmdLine );
59 
63  ~objectTrackerKLT();
64 
68  inline virtual Type GetType() const { return KLT; }
69 
73  virtual int Process( void* image, uint32_t width, uint32_t height, imageFormat format, detectNet::Detection* detections, int numDetections );
74 
75 protected:
76  objectTrackerKLT();
77 
78  bool init( uint32_t width, uint32_t height, imageFormat format );
79  void free();
80 
81  uint32_t mWidth;
82  uint32_t mHeight;
83  uint64_t mFrameCount;
84 
85  imageFormat mFormat;
86 
87  VPIImage mImages[2];
88  VPIArray mInputBoxes;
89  VPIArray mInputPreds;
90  VPIArray mOutputBoxes;
91  VPIArray mOutputPreds;
92  VPIStream mStream;
93  VPIPayload mPayload;
94  VPIKLTFeatureTrackerParams mParams;
95 
96  std::vector<VPIKLTTrackedBoundingBox> mBoxes;
97  std::vector<VPIHomographyTransform2D> mPreds;
98 
99 
100 };
101 
102 #endif
103 #endif
detectNet::Detection
Object Detection result.
Definition: detectNet.h:122
objectTracker::GetType
virtual Type GetType() const =0
GetType.
objectTracker
Object tracker interface.
Definition: objectTracker.h:52
objectTracker::KLT
@ KLT
KLT tracker (only available with VPI)
Definition: objectTracker.h:62
objectTracker::Process
int Process(T *image, uint32_t width, uint32_t height, detectNet::Detection *detections, int numDetections)
Process.
Definition: objectTracker.h:88
commandLine
Command line parser for extracting flags, values, and strings.
Definition: commandLine.h:35
objectTracker::Create
static objectTracker * Create(Type type)
Create a new object tracker.
objectTracker.h
imageFormat
imageFormat
The imageFormat enum is used to identify the pixel format and colorspace of an image.
Definition: imageFormat.h:49