FastDeploy  latest
Fast & Easy to Deploy!
lapjv.h
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 #pragma once
21 #define LARGE 1000000
22 
23 #if !defined TRUE
24 #define TRUE 1
25 #endif
26 #if !defined FALSE
27 #define FALSE 0
28 #endif
29 
30 #define NEW(x, t, n) \
31  if ((x = reinterpret_cast<t *>(malloc(sizeof(t) * (n)))) == 0) { \
32  return -1; \
33  }
34 #define FREE(x) \
35  if (x != 0) { \
36  free(x); \
37  x = 0; \
38  }
39 #define SWAP_INDICES(a, b) \
40  { \
41  int_t _temp_index = a; \
42  a = b; \
43  b = _temp_index; \
44  }
45 #include <opencv2/opencv.hpp>
46 
47 namespace fastdeploy {
48 namespace vision {
49 namespace tracking {
50 
51 typedef signed int int_t;
52 typedef unsigned int uint_t;
53 typedef double cost_t;
54 typedef char boolean;
55 typedef enum fp_t { FP_1 = 1, FP_2 = 2, FP_DYNAMIC = 3 } fp_t;
56 
57 int lapjv_internal(const cv::Mat &cost,
58  const bool extend_cost,
59  const float cost_limit,
60  int *x,
61  int *y);
62 
63 } // namespace tracking
64 } // namespace vision
65 } // namespace fastdeploy
66 
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16