docs/html/objectTrackerIOU_8h_source.html
| | Jetson Inference
DNN Vision Library |
objectTrackerIOU.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_IOU_H__
24 #define __OBJECT_TRACKER_IOU_H__
25
26
27 #include "objectTracker.h"
28
29
34 #define OBJECT_TRACKER_DEFAULT_MIN_FRAMES 3
35
40 #define OBJECT_TRACKER_DEFAULT_DROP_FRAMES 15
41
45 #define OBJECT_TRACKER_DEFAULT_OVERLAP_THRESHOLD 0.5
46
47
59 class objectTrackerIOU : public objectTracker
60 {
61 public:
67static objectTrackerIOU* Create( uint32_t minFrames=OBJECT_TRACKER_DEFAULT_MIN_FRAMES,
68 uint32_t dropFrames=OBJECT_TRACKER_DEFAULT_DROP_FRAMES,
69float overlapThreshold=OBJECT_TRACKER_DEFAULT_OVERLAP_THRESHOLD );
70
74static objectTrackerIOU* Create( int argc, char** argv );
75
79static objectTrackerIOU* Create( const commandLine& cmdLine );
80
84virtual ~objectTrackerIOU();
85
89inline uint32_t GetMinFrames() const { return mMinFrames; }
90
94inline void SetMinFrames( uint32_t frames ) { mMinFrames = frames; }
95
99inline uint32_t GetDropFrames() const { return mDropFrames; }
100
104inline void SetDropFrames( uint32_t frames ) { mDropFrames = frames; }
105
109inline float GetOverlapThreshold() const { return mOverlapThreshold; }
110
114inline void SetOverlapThreshold( float threshold ) { mOverlapThreshold = threshold; }
115
119inline virtual Type GetType() const { return IOU; }
120
124virtual int Process( void* image, uint32_t width, uint32_t height, imageFormat format, detectNet::Detection* detections, int numDetections );
125
126 protected:
127objectTrackerIOU( uint32_t minFrames, uint32_t dropFrames, float overlapThreshold );
128
130 uint64_t mFrameCount;
131
132 uint32_t mMinFrames;
133 uint32_t mDropFrames;
134
135float mOverlapThreshold;
136
137 std::vector<detectNet::Detection> mTracks;
138 };
139
140 #endif
OBJECT_TRACKER_DEFAULT_MIN_FRAMES
#define OBJECT_TRACKER_DEFAULT_MIN_FRAMES
The number of re-identified frames before establishing a track.
Definition: objectTrackerIOU.h:34
uint32_t mIDCount
Definition: objectTrackerIOU.h:129
uint64_t mFrameCount
Definition: objectTrackerIOU.h:130
objectTrackerIOU::SetOverlapThreshold
void SetOverlapThreshold(float threshold)
Set how much IOU overlap is required for a bounding box to be matched.
Definition: objectTrackerIOU.h:114
Object Detection result.
Definition: detectNet.h:122
objectTrackerIOU::SetDropFrames
void SetDropFrames(uint32_t frames)
Set the number of consecutive lost frames after which a track is removed.
Definition: objectTrackerIOU.h:104
Object tracker using Intersection-Over-Union (IOU)
Definition: objectTrackerIOU.h:59
virtual Type GetType() const
Definition: objectTrackerIOU.h:119
objectTrackerIOU::GetMinFrames
uint32_t GetMinFrames() const
The number of re-identified frames before before establishing a track.
Definition: objectTrackerIOU.h:89
uint32_t mMinFrames
Definition: objectTrackerIOU.h:132
objectTrackerIOU::objectTrackerIOU
objectTrackerIOU(uint32_t minFrames, uint32_t dropFrames, float overlapThreshold)
objectTrackerIOU::~objectTrackerIOU
virtual ~objectTrackerIOU()
Destroy.
objectTrackerIOU::GetOverlapThreshold
float GetOverlapThreshold() const
How much IOU overlap is required for a bounding box to be matched.
Definition: objectTrackerIOU.h:109
@ IOU
Intersection-Over-Union (IOU) tracker.
Definition: objectTracker.h:61
std::vector< detectNet::Detection > mTracks
Definition: objectTrackerIOU.h:137
Object tracker interface.
Definition: objectTracker.h:52
OBJECT_TRACKER_DEFAULT_OVERLAP_THRESHOLD
#define OBJECT_TRACKER_DEFAULT_OVERLAP_THRESHOLD
How much IOU overlap is required for a bounding box to be matched.
Definition: objectTrackerIOU.h:45
Type
Tracker type enum.
Definition: objectTracker.h:58
objectTrackerIOU::GetDropFrames
uint32_t GetDropFrames() const
The number of consecutive lost frames after which a track is removed.
Definition: objectTrackerIOU.h:99
objectTrackerIOU::mOverlapThreshold
float mOverlapThreshold
Definition: objectTrackerIOU.h:135
objectTrackerIOU::SetMinFrames
void SetMinFrames(uint32_t frames)
Set the number of re-identified frames before before establishing a track.
Definition: objectTrackerIOU.h:94
uint32_t mDropFrames
Definition: objectTrackerIOU.h:133
OBJECT_TRACKER_DEFAULT_DROP_FRAMES
#define OBJECT_TRACKER_DEFAULT_DROP_FRAMES
The number of consecutive lost frames after which a track is removed.
Definition: objectTrackerIOU.h:40
static objectTrackerIOU * Create(uint32_t minFrames=OBJECT_TRACKER_DEFAULT_MIN_FRAMES, uint32_t dropFrames=OBJECT_TRACKER_DEFAULT_DROP_FRAMES, float overlapThreshold=OBJECT_TRACKER_DEFAULT_OVERLAP_THRESHOLD)
Create a new object tracker.
Command line parser for extracting flags, values, and strings.
Definition: commandLine.h:35
imageFormat
The imageFormat enum is used to identify the pixel format and colorspace of an image.
Definition: imageFormat.h:49
virtual int Process(void *image, uint32_t width, uint32_t height, imageFormat format, detectNet::Detection *detections, int numDetections)