reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-15 aaa1c01fa7febe0de698b38ddae4cfe5fe7cc4ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 *  By downloading, copying, installing or using the software you agree to this license.
 *  If you do not agree to this license, do not download, install,
 *  copy or use the software.
 *
 *
 *  License Agreement
 *  For Open Source Computer Vision Library
 *  (3 - clause BSD License)
 *
 *  Redistribution and use in source and binary forms, with or without modification,
 *  are permitted provided that the following conditions are met :
 *
 *  * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *
 *  * Redistributions in binary form must reproduce the above copyright notice,
 *  this list of conditions and the following disclaimer in the documentation
 *  and / or other materials provided with the distribution.
 *
 *  * Neither the names of the copyright holders nor the names of the contributors
 *  may be used to endorse or promote products derived from this software
 *  without specific prior written permission.
 *
 *  This software is provided by the copyright holders and contributors "as is" and
 *  any express or implied warranties, including, but not limited to, the implied
 *  warranties of merchantability and fitness for a particular purpose are disclaimed.
 *  In no event shall copyright holders or contributors be liable for any direct,
 *  indirect, incidental, special, exemplary, or consequential damages
 *  (including, but not limited to, procurement of substitute goods or services;
 *  loss of use, data, or profits; or business interruption) however caused
 *  and on any theory of liability, whether in contract, strict liability,
 *  or tort(including negligence or otherwise) arising in any way out of
 *  the use of this software, even if advised of the possibility of such damage.
 */
 
#ifndef __OPENCV_SPARSEMATCHINTERPOLATOR_HPP__
#define __OPENCV_SPARSEMATCHINTERPOLATOR_HPP__
#ifdef __cplusplus
 
#include <opencv2/core.hpp>
 
namespace cv {
namespace ximgproc {
 
//! @addtogroup ximgproc_filters
//! @{
 
/** @brief Main interface for all filters, that take sparse matches as an
input and produce a dense per-pixel matching (optical flow) as an output.
 */
class CV_EXPORTS_W SparseMatchInterpolator : public Algorithm
{
public:
    /** @brief Interpolate input sparse matches.
 
    @param from_image first of the two matched images, 8-bit single-channel or three-channel.
 
    @param from_points points of the from_image for which there are correspondences in the
    to_image (Point2f vector, size shouldn't exceed 32767)
 
    @param to_image second of the two matched images, 8-bit single-channel or three-channel.
 
    @param to_points points in the to_image corresponding to from_points
    (Point2f vector, size shouldn't exceed 32767)
 
    @param dense_flow output dense matching (two-channel CV_32F image)
     */
    CV_WRAP virtual void interpolate(InputArray from_image, InputArray from_points,
                                     InputArray to_image  , InputArray to_points,
                                     OutputArray dense_flow) = 0;
};
 
/** @brief Sparse match interpolation algorithm based on modified locally-weighted affine
estimator from @cite Revaud2015 and Fast Global Smoother as post-processing filter.
 */
class CV_EXPORTS_W EdgeAwareInterpolator : public SparseMatchInterpolator
{
public:
    /** @brief K is a number of nearest-neighbor matches considered, when fitting a locally affine
    model. Usually it should be around 128. However, lower values would make the interpolation
    noticeably faster.
     */
    CV_WRAP virtual void setK(int _k) = 0;
    /** @see setK */
    CV_WRAP virtual int  getK() = 0;
 
    /** @brief Sigma is a parameter defining how fast the weights decrease in the locally-weighted affine
    fitting. Higher values can help preserve fine details, lower values can help to get rid of noise in the
    output flow.
     */
    CV_WRAP virtual void  setSigma(float _sigma) = 0;
    /** @see setSigma */
    CV_WRAP virtual float getSigma() = 0;
 
    /** @brief Lambda is a parameter defining the weight of the edge-aware term in geodesic distance,
    should be in the range of 0 to 1000.
     */
    CV_WRAP virtual void  setLambda(float _lambda) = 0;
    /** @see setLambda */
    CV_WRAP virtual float getLambda() = 0;
 
    /** @brief Sets whether the fastGlobalSmootherFilter() post-processing is employed. It is turned on by
    default.
     */
    CV_WRAP virtual void setUsePostProcessing(bool _use_post_proc) = 0;
    /** @see setUsePostProcessing */
    CV_WRAP virtual bool getUsePostProcessing() = 0;
 
    /** @brief Sets the respective fastGlobalSmootherFilter() parameter.
     */
    CV_WRAP virtual void  setFGSLambda(float _lambda) = 0;
    /** @see setFGSLambda */
    CV_WRAP virtual float getFGSLambda() = 0;
 
    /** @see setFGSLambda */
    CV_WRAP virtual void  setFGSSigma(float _sigma) = 0;
    /** @see setFGSLambda */
    CV_WRAP virtual float getFGSSigma() = 0;
};
 
/** @brief Factory method that creates an instance of the
EdgeAwareInterpolator.
*/
CV_EXPORTS_W
Ptr<EdgeAwareInterpolator> createEdgeAwareInterpolator();
 
//! @}
}
}
#endif
#endif