Skip to content

Commit d487f24

Browse files
committed
sfm: avoid variable-names starting with underscore
Resolves #1963
1 parent 2588a5e commit d487f24

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

modules/sfm/src/projection.cpp

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -55,34 +55,34 @@ namespace sfm
5555

5656
template<typename T>
5757
void
58-
homogeneousToEuclidean(const Mat & _X, Mat & _x)
58+
homogeneousToEuclidean(const Mat & X_, Mat & x_)
5959
{
60-
int d = _X.rows - 1;
60+
int d = X_.rows - 1;
6161

62-
const Mat_<T> & X_rows = _X.rowRange(0,d);
63-
const Mat_<T> h = _X.row(d);
62+
const Mat_<T> & X_rows = X_.rowRange(0,d);
63+
const Mat_<T> h = X_.row(d);
6464

6565
const T * h_ptr = h[0], *h_ptr_end = h_ptr + h.cols;
6666
const T * X_ptr = X_rows[0];
67-
T * x_ptr = _x.ptr<T>(0);
67+
T * x_ptr = x_.ptr<T>(0);
6868
for (; h_ptr != h_ptr_end; ++h_ptr, ++X_ptr, ++x_ptr)
6969
{
7070
const T * X_col_ptr = X_ptr;
71-
T * x_col_ptr = x_ptr, *x_col_ptr_end = x_col_ptr + d * _x.step1();
72-
for (; x_col_ptr != x_col_ptr_end; X_col_ptr+=X_rows.step1(), x_col_ptr+=_x.step1() )
71+
T * x_col_ptr = x_ptr, *x_col_ptr_end = x_col_ptr + d * x_.step1();
72+
for (; x_col_ptr != x_col_ptr_end; X_col_ptr+=X_rows.step1(), x_col_ptr+=x_.step1() )
7373
*x_col_ptr = (*X_col_ptr) / (*h_ptr);
7474
}
7575
}
7676

7777
void
78-
homogeneousToEuclidean(InputArray _X, OutputArray _x)
78+
homogeneousToEuclidean(InputArray X_, OutputArray x_)
7979
{
8080
// src
81-
const Mat X = _X.getMat();
81+
const Mat X = X_.getMat();
8282

8383
// dst
84-
_x.create(X.rows-1, X.cols, X.type());
85-
Mat x = _x.getMat();
84+
x_.create(X.rows-1, X.cols, X.type());
85+
Mat x = x_.getMat();
8686

8787
// type
8888
if( X.depth() == CV_32F )
@@ -96,11 +96,11 @@ homogeneousToEuclidean(InputArray _X, OutputArray _x)
9696
}
9797

9898
void
99-
euclideanToHomogeneous(InputArray _x, OutputArray _X)
99+
euclideanToHomogeneous(InputArray x_, OutputArray X_)
100100
{
101-
const Mat x = _x.getMat();
101+
const Mat x = x_.getMat();
102102
const Mat last_row = Mat::ones(1, x.cols, x.type());
103-
vconcat(x, last_row, _X);
103+
vconcat(x, last_row, X_);
104104
}
105105

106106
template<typename T>
@@ -111,16 +111,16 @@ projectionFromKRt(const Mat_<T> &K, const Mat_<T> &R, const Mat_<T> &t, Mat_<T>
111111
}
112112

113113
void
114-
projectionFromKRt(InputArray _K, InputArray _R, InputArray _t, OutputArray _P)
114+
projectionFromKRt(InputArray K_, InputArray R_, InputArray t_, OutputArray P_)
115115
{
116-
const Mat K = _K.getMat(), R = _R.getMat(), t = _t.getMat();
116+
const Mat K = K_.getMat(), R = R_.getMat(), t = t_.getMat();
117117
const int depth = K.depth();
118118
CV_Assert((K.cols == 3 && K.rows == 3) && (t.cols == 1 && t.rows == 3) && (K.size() == R.size()));
119119
CV_Assert((depth == CV_32F || depth == CV_64F) && depth == R.depth() && depth == t.depth());
120120

121-
_P.create(3, 4, depth);
121+
P_.create(3, 4, depth);
122122

123-
Mat P = _P.getMat();
123+
Mat P = P_.getMat();
124124

125125
// type
126126
if( depth == CV_32F )
@@ -136,33 +136,33 @@ projectionFromKRt(InputArray _K, InputArray _R, InputArray _t, OutputArray _P)
136136

137137
template<typename T>
138138
void
139-
KRtFromProjection( const Mat_<T> &_P, Mat_<T> _K, Mat_<T> _R, Mat_<T> _t )
139+
KRtFromProjection( const Mat_<T> &P_, Mat_<T> K_, Mat_<T> R_, Mat_<T> t_ )
140140
{
141141
libmv::Mat34 P;
142142
libmv::Mat3 K, R;
143143
libmv::Vec3 t;
144144

145-
cv2eigen( _P, P );
145+
cv2eigen( P_, P );
146146

147147
libmv::KRt_From_P( P, &K, &R, &t );
148148

149-
eigen2cv( K, _K );
150-
eigen2cv( R, _R );
151-
eigen2cv( t, _t );
149+
eigen2cv( K, K_ );
150+
eigen2cv( R, R_ );
151+
eigen2cv( t, t_ );
152152
}
153153

154154
void
155-
KRtFromProjection( InputArray _P, OutputArray _K, OutputArray _R, OutputArray _t )
155+
KRtFromProjection( InputArray P_, OutputArray K_, OutputArray R_, OutputArray t_ )
156156
{
157-
const Mat P = _P.getMat();
157+
const Mat P = P_.getMat();
158158
const int depth = P.depth();
159159
CV_Assert((P.cols == 4 && P.rows == 3) && (depth == CV_32F || depth == CV_64F));
160160

161-
_K.create(3, 3, depth);
162-
_R.create(3, 3, depth);
163-
_t.create(3, 1, depth);
161+
K_.create(3, 3, depth);
162+
R_.create(3, 3, depth);
163+
t_.create(3, 1, depth);
164164

165-
Mat K = _K.getMat(), R = _R.getMat(), t = _t.getMat();
165+
Mat K = K_.getMat(), R = R_.getMat(), t = t_.getMat();
166166

167167
// type
168168
if( depth == CV_32F )
@@ -177,29 +177,29 @@ KRtFromProjection( InputArray _P, OutputArray _K, OutputArray _R, OutputArray _t
177177

178178
template<typename T>
179179
T
180-
depthValue( const Mat_<T> &_R, const Mat_<T> &_t, const Mat_<T> &_X )
180+
depthValue( const Mat_<T> &R_, const Mat_<T> &t_, const Mat_<T> &X_ )
181181
{
182-
Matx<T,3,3> R(_R);
183-
Vec<T,3> t(_t);
182+
Matx<T,3,3> R(R_);
183+
Vec<T,3> t(t_);
184184

185-
if ( _X.rows == 3)
185+
if ( X_.rows == 3)
186186
{
187-
Vec<T,3> X(_X);
187+
Vec<T,3> X(X_);
188188
return (R*X)(2) + t(2);
189189
}
190190
else
191191
{
192-
Vec<T,4> X(_X);
192+
Vec<T,4> X(X_);
193193
Vec<T,3> Xe;
194194
homogeneousToEuclidean(X,Xe);
195195
return depthValue<T>( Mat(R), Mat(t), Mat(Xe) );
196196
}
197197
}
198198

199199
double
200-
depth( InputArray _R, InputArray _t, InputArray _X)
200+
depth( InputArray R_, InputArray t_, InputArray X_)
201201
{
202-
const Mat R = _R.getMat(), t = _t.getMat(), X = _X.getMat();
202+
const Mat R = R_.getMat(), t = t_.getMat(), X = X_.getMat();
203203
const int depth = R.depth();
204204
CV_Assert( R.rows == 3 && R.cols == 3 && t.rows == 3 && t.cols == 1 );
205205
CV_Assert( (X.rows == 3 && X.cols == 1) || (X.rows == 4 && X.cols == 1) );

0 commit comments

Comments
 (0)