nndeploy C++ API  0.2.0
nndeploy C++ API
lapjv.h
Go to the documentation of this file.
1 // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // The code is based on:
16 // https://github.com/gatagat/lap/blob/master/lap/lapjv.h
17 // Ths copyright of gatagat/lap is as follows:
18 // MIT License
19 // ----------------------------------------------------------------------
20 // Modified by nndeploy on 2025-05-30
21 // ----------------------------------------------------------------------
22 #ifndef _NNDEPLOY_TRACK_LAPJV_H_
23 #define _NNDEPLOY_TRACK_LAPJV_H_
24 
25 #define LARGE 1000000
26 
27 #if !defined TRUE
28 #define TRUE 1
29 #endif
30 #if !defined FALSE
31 #define FALSE 0
32 #endif
33 
34 #define NEW(x, t, n) \
35  if ((x = reinterpret_cast<t *>(malloc(sizeof(t) * (n)))) == 0) { \
36  return -1; \
37  }
38 #define FREE(x) \
39  if (x != 0) { \
40  free(x); \
41  x = 0; \
42  }
43 #define SWAP_INDICES(a, b) \
44  { \
45  int_t _temp_index = a; \
46  a = b; \
47  b = _temp_index; \
48  }
49 #include <opencv2/opencv.hpp>
50 
51 namespace nndeploy {
52 namespace track {
53 
54 typedef signed int int_t;
55 typedef unsigned int uint_t;
56 typedef double cost_t;
57 typedef char boolean;
58 typedef enum fp_t { FP_1 = 1, FP_2 = 2, FP_DYNAMIC = 3 } fp_t;
59 
60 int lapjv_internal(const cv::Mat &cost, const bool extend_cost,
61  const float cost_limit, int *x, int *y);
62 
63 } // namespace track
64 } // namespace nndeploy
65 
66 #endif
double cost_t
Definition: lapjv.h:56
signed int int_t
Definition: lapjv.h:54
unsigned int uint_t
Definition: lapjv.h:55
char boolean
Definition: lapjv.h:57
int lapjv_internal(const cv::Mat &cost, const bool extend_cost, const float cost_limit, int *x, int *y)