@@ -24,42 +24,44 @@ namespace stereo
24
24
25
25
26
26
// A basic match structure
27
- struct CV_EXPORTS Match
27
+ struct CV_EXPORTS_W_SIMPLE MatchQuasiDense
28
28
{
29
- cv::Point2i p0;
30
- cv::Point2i p1;
31
- float corr;
29
+ CV_PROP_RW cv::Point2i p0;
30
+ CV_PROP_RW cv::Point2i p1;
31
+ CV_PROP_RW float corr;
32
32
33
- bool operator < (const Match & rhs) const // fixme may be used uninitialized in this function
33
+ CV_WRAP MatchQuasiDense () { corr = 0 ; }
34
+
35
+ CV_WRAP_AS (apply) bool operator < (const MatchQuasiDense & rhs) const // fixme may be used uninitialized in this function
34
36
{
35
37
return this ->corr < rhs.corr ;
36
38
}
37
39
};
38
- struct CV_EXPORTS PropagationParameters
40
+ struct CV_EXPORTS_W_SIMPLE PropagationParameters
39
41
{
40
- int corrWinSizeX; // similarity window
41
- int corrWinSizeY;
42
+ CV_PROP_RW int corrWinSizeX; // similarity window
43
+ CV_PROP_RW int corrWinSizeY;
42
44
43
- int borderX; // border to ignore
44
- int borderY;
45
+ CV_PROP_RW int borderX; // border to ignore
46
+ CV_PROP_RW int borderY;
45
47
46
48
// matching
47
- float correlationThreshold; // correlation threshold
48
- float textrureThreshold; // texture threshold
49
+ CV_PROP_RW float correlationThreshold; // correlation threshold
50
+ CV_PROP_RW float textrureThreshold; // texture threshold
49
51
50
- int neighborhoodSize; // neighborhood size
51
- int disparityGradient; // disparity gradient threshold
52
+ CV_PROP_RW int neighborhoodSize; // neighborhood size
53
+ CV_PROP_RW int disparityGradient; // disparity gradient threshold
52
54
53
55
// Parameters for LK flow algorithm
54
- int lkTemplateSize;
55
- int lkPyrLvl;
56
- int lkTermParam1;
57
- float lkTermParam2;
56
+ CV_PROP_RW int lkTemplateSize;
57
+ CV_PROP_RW int lkPyrLvl;
58
+ CV_PROP_RW int lkTermParam1;
59
+ CV_PROP_RW float lkTermParam2;
58
60
59
61
// Parameters for GFT algorithm.
60
- float gftQualityThres;
61
- int gftMinSeperationDist;
62
- int gftMaxNumFeatures;
62
+ CV_PROP_RW float gftQualityThres;
63
+ CV_PROP_RW int gftMinSeperationDist;
64
+ CV_PROP_RW int gftMaxNumFeatures;
63
65
64
66
};
65
67
@@ -90,14 +92,14 @@ struct CV_EXPORTS PropagationParameters
90
92
*
91
93
*/
92
94
93
- class CV_EXPORTS QuasiDenseStereo
95
+ class CV_EXPORTS_W QuasiDenseStereo
94
96
{
95
97
public:
96
98
/* *
97
99
* @brief destructor
98
100
* Method to free all the memory allocated by matrices and vectors in this class.
99
101
*/
100
- virtual ~QuasiDenseStereo () = 0 ;
102
+ CV_WRAP virtual ~QuasiDenseStereo () = 0 ;
101
103
102
104
103
105
/* *
@@ -113,7 +115,7 @@ class CV_EXPORTS QuasiDenseStereo
113
115
* in case of video processing.
114
116
* @sa loadParameters
115
117
*/
116
- virtual int loadParameters (cv::String filepath) = 0;
118
+ CV_WRAP virtual int loadParameters (cv::String filepath) = 0;
117
119
118
120
119
121
/* *
@@ -124,7 +126,7 @@ class CV_EXPORTS QuasiDenseStereo
124
126
* @note This method can be used to generate a template file for tuning the class.
125
127
* @sa loadParameters
126
128
*/
127
- virtual int saveParameters (cv::String filepath) = 0;
129
+ CV_WRAP virtual int saveParameters (cv::String filepath) = 0;
128
130
129
131
130
132
/* *
@@ -133,7 +135,7 @@ class CV_EXPORTS QuasiDenseStereo
133
135
* @note The method clears the sMatches vector.
134
136
* @note The returned Match elements inside the sMatches vector, do not use corr member.
135
137
*/
136
- virtual void getSparseMatches (std::vector<stereo::Match > &sMatches ) = 0;
138
+ CV_WRAP virtual void getSparseMatches (CV_OUT std::vector<MatchQuasiDense > &sMatches ) = 0;
137
139
138
140
139
141
/* *
@@ -142,7 +144,7 @@ class CV_EXPORTS QuasiDenseStereo
142
144
* @note The method clears the denseMatches vector.
143
145
* @note The returned Match elements inside the sMatches vector, do not use corr member.
144
146
*/
145
- virtual void getDenseMatches (std::vector<stereo::Match > &denseMatches) = 0;
147
+ CV_WRAP virtual void getDenseMatches (CV_OUT std::vector<MatchQuasiDense > &denseMatches) = 0;
146
148
147
149
148
150
@@ -158,7 +160,7 @@ class CV_EXPORTS QuasiDenseStereo
158
160
* @sa sparseMatching
159
161
* @sa quasiDenseMatching
160
162
*/
161
- virtual void process (const cv::Mat &imgLeft ,const cv::Mat &imgRight) = 0;
163
+ CV_WRAP virtual void process (const cv::Mat &imgLeft ,const cv::Mat &imgRight) = 0;
162
164
163
165
164
166
/* *
@@ -169,7 +171,7 @@ class CV_EXPORTS QuasiDenseStereo
169
171
* @retval cv::Point(0, 0) (NO_MATCH) if no match is found in the right image for the specified pixel location in the left image.
170
172
* @note This method should be always called after process, otherwise the matches will not be correct.
171
173
*/
172
- virtual cv::Point2f getMatch (const int x, const int y) = 0;
174
+ CV_WRAP virtual cv::Point2f getMatch (const int x, const int y) = 0;
173
175
174
176
175
177
/* *
@@ -180,13 +182,13 @@ class CV_EXPORTS QuasiDenseStereo
180
182
* @sa computeDisparity
181
183
* @sa quantizeDisparity
182
184
*/
183
- virtual cv::Mat getDisparity (uint8_t disparityLvls=50 ) = 0;
185
+ CV_WRAP virtual cv::Mat getDisparity (uint8_t disparityLvls=50 ) = 0;
184
186
185
187
186
- static cv::Ptr <QuasiDenseStereo> create (cv::Size monoImgSize, cv::String paramFilepath = cv::String());
188
+ CV_WRAP static cv::Ptr <QuasiDenseStereo> create (cv::Size monoImgSize, cv::String paramFilepath = cv::String());
187
189
188
190
189
- PropagationParameters Param;
191
+ CV_PROP_RW PropagationParameters Param;
190
192
};
191
193
192
194
} // namespace cv
0 commit comments