Skip to content

Commit 3066970

Browse files
committed
Merge pull request #1352 from alalek:type_traits_issue_7599
2 parents 5472ac0 + e242e87 commit 3066970

File tree

15 files changed

+75
-72
lines changed

15 files changed

+75
-72
lines changed

modules/bgsegm/src/bgfg_gmg.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class BackgroundSubtractorGMGImpl : public BackgroundSubtractorGMG
194194
String name_;
195195

196196
Mat_<int> nfeatures_;
197-
Mat_<unsigned int> colors_;
197+
Mat_<int> colors_;
198198
Mat_<float> weights_;
199199

200200
Mat buf_;
@@ -223,7 +223,7 @@ void BackgroundSubtractorGMGImpl::initialize(Size frameSize, double minVal, doub
223223
nfeatures_.setTo(Scalar::all(0));
224224
}
225225

226-
static float findFeature(unsigned int color, const unsigned int* colors, const float* weights, int nfeatures)
226+
static float findFeature(int color, const int* colors, const float* weights, int nfeatures)
227227
{
228228
for (int i = 0; i < nfeatures; ++i)
229229
{
@@ -248,7 +248,7 @@ static void normalizeHistogram(float* weights, int nfeatures)
248248
}
249249
}
250250

251-
static bool insertFeature(unsigned int color, float weight, unsigned int* colors, float* weights, int& nfeatures, int maxFeatures)
251+
static bool insertFeature(int color, float weight, int* colors, float* weights, int& nfeatures, int maxFeatures)
252252
{
253253
int idx = -1;
254254
for (int i = 0; i < nfeatures; ++i)
@@ -266,7 +266,7 @@ static bool insertFeature(unsigned int color, float weight, unsigned int* colors
266266
{
267267
// move feature to beginning of list
268268

269-
::memmove(colors + 1, colors, idx * sizeof(unsigned int));
269+
::memmove(colors + 1, colors, idx * sizeof(int));
270270
::memmove(weights + 1, weights, idx * sizeof(float));
271271

272272
colors[0] = color;
@@ -276,7 +276,7 @@ static bool insertFeature(unsigned int color, float weight, unsigned int* colors
276276
{
277277
// discard oldest feature
278278

279-
::memmove(colors + 1, colors, (nfeatures - 1) * sizeof(unsigned int));
279+
::memmove(colors + 1, colors, (nfeatures - 1) * sizeof(int));
280280
::memmove(weights + 1, weights, (nfeatures - 1) * sizeof(float));
281281

282282
colors[0] = color;
@@ -297,7 +297,7 @@ static bool insertFeature(unsigned int color, float weight, unsigned int* colors
297297

298298
template <typename T> struct Quantization
299299
{
300-
static unsigned int apply(const void* src_, int x, int cn, double minVal, double maxVal, int quantizationLevels)
300+
static int apply(const void* src_, int x, int cn, double minVal, double maxVal, int quantizationLevels)
301301
{
302302
const T* src = static_cast<const T*>(src_);
303303
src += x * cn;
@@ -313,7 +313,7 @@ template <typename T> struct Quantization
313313
class GMG_LoopBody : public ParallelLoopBody
314314
{
315315
public:
316-
GMG_LoopBody(const Mat& frame, const Mat& fgmask, const Mat_<int>& nfeatures, const Mat_<unsigned int>& colors, const Mat_<float>& weights,
316+
GMG_LoopBody(const Mat& frame, const Mat& fgmask, const Mat_<int>& nfeatures, const Mat_<int>& colors, const Mat_<float>& weights,
317317
int maxFeatures, double learningRate, int numInitializationFrames, int quantizationLevels, double backgroundPrior, double decisionThreshold,
318318
double maxVal, double minVal, int frameNum, bool updateBackgroundModel) :
319319
frame_(frame), fgmask_(fgmask), nfeatures_(nfeatures), colors_(colors), weights_(weights),
@@ -331,7 +331,7 @@ class GMG_LoopBody : public ParallelLoopBody
331331
mutable Mat_<uchar> fgmask_;
332332

333333
mutable Mat_<int> nfeatures_;
334-
mutable Mat_<unsigned int> colors_;
334+
mutable Mat_<int> colors_;
335335
mutable Mat_<float> weights_;
336336

337337
int maxFeatures_;
@@ -349,7 +349,7 @@ class GMG_LoopBody : public ParallelLoopBody
349349

350350
void GMG_LoopBody::operator() (const Range& range) const
351351
{
352-
typedef unsigned int (*func_t)(const void* src_, int x, int cn, double minVal, double maxVal, int quantizationLevels);
352+
typedef int (*func_t)(const void* src_, int x, int cn, double minVal, double maxVal, int quantizationLevels);
353353
static const func_t funcs[] =
354354
{
355355
Quantization<uchar>::apply,
@@ -375,10 +375,10 @@ void GMG_LoopBody::operator() (const Range& range) const
375375
for (int x = 0; x < frame_.cols; ++x, ++featureIdx)
376376
{
377377
int nfeatures = nfeatures_row[x];
378-
unsigned int* colors = colors_[featureIdx];
378+
int* colors = colors_[featureIdx];
379379
float* weights = weights_[featureIdx];
380380

381-
unsigned int newFeatureColor = func(frame_row, x, cn, minVal_, maxVal_, quantizationLevels_);
381+
int newFeatureColor = func(frame_row, x, cn, minVal_, maxVal_, quantizationLevels_);
382382

383383
bool isForeground = false;
384384

modules/ccalib/include/opencv2/ccalib.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CV_EXPORTS CustomPattern : public Algorithm
7171

7272
bool isInitialized();
7373

74-
void getPatternPoints(OutputArray original_points);
74+
void getPatternPoints(std::vector<KeyPoint>& original_points);
7575
/**<
7676
Returns a vector<Point> of the original points.
7777
*/

modules/ccalib/src/ccalib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ bool CustomPattern::findPattern(InputArray image, OutputArray matched_features,
405405
return (!m_ftrs.empty());
406406
}
407407

408-
void CustomPattern::getPatternPoints(OutputArray original_points)
408+
void CustomPattern::getPatternPoints(std::vector<KeyPoint>& original_points)
409409
{
410-
return Mat(keypoints).copyTo(original_points);
410+
original_points = keypoints;
411411
}
412412

413413
double CustomPattern::getPixelSize()

modules/optflow/src/simpleflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class CrossBilateralFilter : public ParallelLoopBody {
131131
flag(flag_),
132132
spaceWeights(spaceWeights_),
133133
expLut(expLut_) {
134-
CV_DbgAssert(joint.type() == JointVec::type && confidence.type() == CV_32F && src.type() == dst.type() && src.type() == SrcVec::type);
134+
CV_DbgAssert(joint.type() == traits::Type<JointVec>::value && confidence.type() == CV_32F && src.type() == dst.type() && src.type() == traits::Type<SrcVec>::value);
135135
CV_DbgAssert(joint.rows == src.rows && confidence.rows == src.rows && src.rows == dst.rows + 2 * radius);
136136
CV_DbgAssert(joint.cols == src.cols && confidence.cols == src.cols && src.cols == dst.cols + 2 * radius);
137137
}

modules/rgbd/include/opencv2/rgbd/linemod.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct CV_EXPORTS_W_SIMPLE Template
8080
CV_PROP int width;
8181
CV_PROP int height;
8282
CV_PROP int pyramid_level;
83-
CV_PROP std::vector<Feature> features;
83+
std::vector<Feature> features; // FIXIT: CV_PROP
8484

8585
void read(const FileNode& fn);
8686
void write(FileStorage& fs) const;

modules/saliency/src/BING/FilterTIG.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,22 @@ namespace cv
4747
namespace saliency
4848
{
4949

50+
typedef int64_t TIG_TYPE;
51+
typedef double MAT_TIG_TYPE; // cv::Mat has no native support for int64/uint64
52+
5053
struct TIGbits
5154
{
5255
TIGbits() : bc0(0), bc1(0) {}
53-
inline void accumulate(int64_t tig, int64_t tigMask0, int64_t tigMask1, uchar shift)
56+
inline void accumulate(TIG_TYPE tig, TIG_TYPE tigMask0, TIG_TYPE tigMask1, uchar shift)
5457
{
5558
bc0 += ((POPCNT64(tigMask0 & tig) << 1) - POPCNT64(tig)) << shift;
5659
bc1 += ((POPCNT64(tigMask1 & tig) << 1) - POPCNT64(tig)) << shift;
5760
}
58-
int64_t bc0;
59-
int64_t bc1;
61+
TIG_TYPE bc0;
62+
TIG_TYPE bc1;
6063
};
6164

62-
float ObjectnessBING::FilterTIG::dot( int64_t tig1, int64_t tig2, int64_t tig4, int64_t tig8 )
65+
float ObjectnessBING::FilterTIG::dot( TIG_TYPE tig1, TIG_TYPE tig2, TIG_TYPE tig4, TIG_TYPE tig8 )
6366
{
6467
TIGbits x;
6568
x.accumulate(tig1, _bTIGs[0], _bTIGs[1], 0);
@@ -111,22 +114,22 @@ Mat ObjectnessBING::FilterTIG::matchTemplate( const Mat &mag1u )
111114
{
112115
const int H = mag1u.rows, W = mag1u.cols;
113116
const Size sz( W + 1, H + 1 ); // Expand original size to avoid dealing with boundary conditions
114-
Mat_<int64_t> Tig1 = Mat_<int64_t>::zeros( sz ), Tig2 = Mat_<int64_t>::zeros( sz );
115-
Mat_<int64_t> Tig4 = Mat_<int64_t>::zeros( sz ), Tig8 = Mat_<int64_t>::zeros( sz );
117+
Mat_<MAT_TIG_TYPE> Tig1 = Mat_<MAT_TIG_TYPE>::zeros( sz ), Tig2 = Mat_<MAT_TIG_TYPE>::zeros( sz );
118+
Mat_<MAT_TIG_TYPE> Tig4 = Mat_<MAT_TIG_TYPE>::zeros( sz ), Tig8 = Mat_<MAT_TIG_TYPE>::zeros( sz );
116119
Mat_<BYTE> Row1 = Mat_<BYTE>::zeros( sz ), Row2 = Mat_<BYTE>::zeros( sz );
117120
Mat_<BYTE> Row4 = Mat_<BYTE>::zeros( sz ), Row8 = Mat_<BYTE>::zeros( sz );
118121
Mat_<float> scores( sz );
119122
for ( int y = 1; y <= H; y++ )
120123
{
121124
const BYTE* G = mag1u.ptr<BYTE>( y - 1 );
122-
int64_t* T1 = Tig1.ptr<int64_t>( y ); // Binary TIG of current row
123-
int64_t* T2 = Tig2.ptr<int64_t>( y );
124-
int64_t* T4 = Tig4.ptr<int64_t>( y );
125-
int64_t* T8 = Tig8.ptr<int64_t>( y );
126-
int64_t* Tu1 = Tig1.ptr<int64_t>( y - 1 ); // Binary TIG of upper row
127-
int64_t* Tu2 = Tig2.ptr<int64_t>( y - 1 );
128-
int64_t* Tu4 = Tig4.ptr<int64_t>( y - 1 );
129-
int64_t* Tu8 = Tig8.ptr<int64_t>( y - 1 );
125+
TIG_TYPE* T1 = Tig1.ptr<TIG_TYPE>( y ); // Binary TIG of current row
126+
TIG_TYPE* T2 = Tig2.ptr<TIG_TYPE>( y );
127+
TIG_TYPE* T4 = Tig4.ptr<TIG_TYPE>( y );
128+
TIG_TYPE* T8 = Tig8.ptr<TIG_TYPE>( y );
129+
TIG_TYPE* Tu1 = Tig1.ptr<TIG_TYPE>( y - 1 ); // Binary TIG of upper row
130+
TIG_TYPE* Tu2 = Tig2.ptr<TIG_TYPE>( y - 1 );
131+
TIG_TYPE* Tu4 = Tig4.ptr<TIG_TYPE>( y - 1 );
132+
TIG_TYPE* Tu8 = Tig8.ptr<TIG_TYPE>( y - 1 );
130133
BYTE* R1 = Row1.ptr<BYTE>( y );
131134
BYTE* R2 = Row2.ptr<BYTE>( y );
132135
BYTE* R4 = Row4.ptr<BYTE>( y );

modules/structured_light/include/opencv2/structured_light/structured_light.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CV_EXPORTS_W StructuredLightPattern : public virtual Algorithm
7878
@note All the images must be at the same resolution.
7979
*/
8080
CV_WRAP
81-
virtual bool decode( InputArrayOfArrays patternImages, OutputArray disparityMap,
81+
virtual bool decode( const std::vector< std::vector<Mat> >& patternImages, OutputArray disparityMap,
8282
InputArrayOfArrays blackImages = noArray(),
8383
InputArrayOfArrays whiteImages = noArray(),
8484
int flags = DECODE_3D_UNDERWORLD ) const = 0;

modules/structured_light/src/graycodepattern.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CV_EXPORTS_W GrayCodePattern_Impl : public GrayCodePattern
5656
bool generate( OutputArrayOfArrays patternImages );
5757

5858
// Decodes the gray code pattern, computing the disparity map
59-
bool decode( InputArrayOfArrays patternImages, OutputArray disparityMap, InputArrayOfArrays blackImages = noArray(),
59+
bool decode( const std::vector< std::vector<Mat> >& patternImages, OutputArray disparityMap, InputArrayOfArrays blackImages = noArray(),
6060
InputArrayOfArrays whiteImages = noArray(), int flags = DECODE_3D_UNDERWORLD ) const;
6161

6262
// Returns the number of pattern images for the graycode pattern
@@ -209,10 +209,10 @@ bool GrayCodePattern_Impl::generate( OutputArrayOfArrays pattern )
209209
return true;
210210
}
211211

212-
bool GrayCodePattern_Impl::decode( InputArrayOfArrays patternImages, OutputArray disparityMap,
212+
bool GrayCodePattern_Impl::decode( const std::vector< std::vector<Mat> >& patternImages, OutputArray disparityMap,
213213
InputArrayOfArrays blackImages, InputArrayOfArrays whitheImages, int flags ) const
214214
{
215-
std::vector<std::vector<Mat> >& acquired_pattern = *( std::vector<std::vector<Mat> >* ) patternImages.getObj();
215+
const std::vector<std::vector<Mat> >& acquired_pattern = patternImages;
216216

217217
if( flags == DECODE_3D_UNDERWORLD )
218218
{

modules/structured_light/src/sinusoidalpattern.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CV_EXPORTS_W SinusoidalPatternProfilometry_Impl : public SinusoidalPattern
5656
// Generate sinusoidal patterns
5757
bool generate( OutputArrayOfArrays patternImages );
5858

59-
bool decode( InputArrayOfArrays patternImages, OutputArray disparityMap,
59+
bool decode( const std::vector< std::vector<Mat> >& patternImages, OutputArray disparityMap,
6060
InputArrayOfArrays blackImages = noArray(), InputArrayOfArrays whiteImages =
6161
noArray(), int flags = 0 ) const;
6262

@@ -258,7 +258,7 @@ bool SinusoidalPatternProfilometry_Impl::generate( OutputArrayOfArrays pattern )
258258
return true;
259259
}
260260

261-
bool SinusoidalPatternProfilometry_Impl::decode( InputArrayOfArrays patternImages,
261+
bool SinusoidalPatternProfilometry_Impl::decode(const std::vector< std::vector<Mat> >& patternImages,
262262
OutputArray disparityMap,
263263
InputArrayOfArrays blackImages,
264264
InputArrayOfArrays whiteImages, int flags ) const

modules/ximgproc/src/dtfilter_cpu.inl.hpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ DTFilterCPU* DTFilterCPU::create_p_(const Mat& guide, double sigmaSpatial, doubl
6969
template<typename GuideVec>
7070
void DTFilterCPU::init_(Mat& guide, double sigmaSpatial_, double sigmaColor_, int mode_, int numIters_)
7171
{
72-
CV_Assert(guide.type() == cv::DataType<GuideVec>::type);
72+
CV_Assert(guide.type() == traits::Type<GuideVec>::value);
7373

7474
this->release();
7575

@@ -123,7 +123,7 @@ template <typename SrcVec>
123123
void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
124124
{
125125
typedef typename DataType<Vec<WorkType, SrcVec::channels> >::vec_type WorkVec;
126-
CV_Assert( src.type() == SrcVec::type );
126+
CV_Assert( src.type() == traits::Type<SrcVec>::value );
127127
if ( src.cols != w || src.rows != h )
128128
{
129129
CV_Error(Error::StsBadSize, "Size of filtering image must be equal to size of guide image");
@@ -139,17 +139,17 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
139139
if (dDepth == -1) dDepth = src.depth();
140140

141141
//small optimization to avoid extra copying of data
142-
bool useDstAsRes = (dDepth == WorkVec::depth && (mode == DTF_NC || mode == DTF_RF));
142+
bool useDstAsRes = (dDepth == traits::Depth<WorkVec>::value && (mode == DTF_NC || mode == DTF_RF));
143143
if (useDstAsRes)
144144
{
145-
dst.create(h, w, WorkVec::type);
145+
dst.create(h, w, traits::Type<WorkVec>::value);
146146
res = dst;
147147
}
148148

149149
if (mode == DTF_NC)
150150
{
151-
Mat resT(src.cols, src.rows, WorkVec::type);
152-
src.convertTo(res, WorkVec::type);
151+
Mat resT(src.cols, src.rows, traits::Type<WorkVec>::value);
152+
src.convertTo(res, traits::Type<WorkVec>::value);
153153

154154
FilterNC_horPass<WorkVec> horParBody(res, idistHor, resT);
155155
FilterNC_horPass<WorkVec> vertParBody(resT, idistVert, res);
@@ -180,7 +180,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
180180
}
181181
else if (mode == DTF_RF)
182182
{
183-
src.convertTo(res, WorkVec::type);
183+
src.convertTo(res, traits::Type<WorkVec>::value);
184184

185185
for (int iter = 1; iter <= numIters; iter++)
186186
{
@@ -237,13 +237,13 @@ void DTFilterCPU::integrateSparseRow(const SrcVec *src, const float *dist, SrcWo
237237
template<typename WorkVec>
238238
void DTFilterCPU::prepareSrcImg_IC(const Mat& src, Mat& dst, Mat& dstT)
239239
{
240-
Mat dstOut(src.rows, src.cols + 2, WorkVec::type);
241-
Mat dstOutT(src.cols, src.rows + 2, WorkVec::type);
240+
Mat dstOut(src.rows, src.cols + 2, traits::Type<WorkVec>::value);
241+
Mat dstOutT(src.cols, src.rows + 2, traits::Type<WorkVec>::value);
242242

243243
dst = dstOut(Range::all(), Range(1, src.cols+1));
244244
dstT = dstOutT(Range::all(), Range(1, src.rows+1));
245245

246-
src.convertTo(dst, WorkVec::type);
246+
src.convertTo(dst, traits::Type<WorkVec>::value);
247247

248248
WorkVec *line;
249249
int ri = dstOut.cols - 1;
@@ -270,7 +270,7 @@ template <typename WorkVec>
270270
DTFilterCPU::FilterNC_horPass<WorkVec>::FilterNC_horPass(Mat& src_, Mat& idist_, Mat& dst_)
271271
: src(src_), idist(idist_), dst(dst_), radius(1.0f)
272272
{
273-
CV_DbgAssert(src.type() == WorkVec::type && dst.type() == WorkVec::type && dst.rows == src.cols && dst.cols == src.rows);
273+
CV_DbgAssert(src.type() == traits::Type<WorkVec>::value && dst.type() == traits::Type<WorkVec>::value && dst.rows == src.cols && dst.cols == src.rows);
274274
}
275275

276276
template <typename WorkVec>
@@ -324,12 +324,12 @@ template <typename WorkVec>
324324
DTFilterCPU::FilterIC_horPass<WorkVec>::FilterIC_horPass(Mat& src_, Mat& idist_, Mat& dist_, Mat& dst_)
325325
: src(src_), idist(idist_), dist(dist_), dst(dst_), radius(1.0f)
326326
{
327-
CV_DbgAssert(src.type() == WorkVec::type && dst.type() == WorkVec::type && dst.rows == src.cols && dst.cols == src.rows);
327+
CV_DbgAssert(src.type() == traits::Type<WorkVec>::value && dst.type() == traits::Type<WorkVec>::value && dst.rows == src.cols && dst.cols == src.rows);
328328

329329
#ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY
330-
isrcBuf.create(cv::getNumThreads(), src.cols + 1, WorkVec::type);
330+
isrcBuf.create(cv::getNumThreads(), src.cols + 1, traits::Type<WorkVec>::value);
331331
#else
332-
isrcBuf.create(src.rows, src.cols + 1, WorkVec::type);
332+
isrcBuf.create(src.rows, src.cols + 1, traits::Type<WorkVec>::value);
333333
#endif
334334
}
335335

@@ -384,8 +384,8 @@ template <typename WorkVec>
384384
DTFilterCPU::FilterRF_horPass<WorkVec>::FilterRF_horPass(Mat& res_, Mat& alphaD_, int iteration_)
385385
: res(res_), alphaD(alphaD_), iteration(iteration_)
386386
{
387-
CV_DbgAssert(res.type() == WorkVec::type);
388-
CV_DbgAssert(res.type() == WorkVec::type && res.size() == res.size());
387+
CV_DbgAssert(res.type() == traits::Type<WorkVec>::value);
388+
CV_DbgAssert(res.type() == traits::Type<WorkVec>::value && res.size() == res.size());
389389
}
390390

391391

@@ -421,8 +421,8 @@ template <typename WorkVec>
421421
DTFilterCPU::FilterRF_vertPass<WorkVec>::FilterRF_vertPass(Mat& res_, Mat& alphaD_, int iteration_)
422422
: res(res_), alphaD(alphaD_), iteration(iteration_)
423423
{
424-
CV_DbgAssert(res.type() == WorkVec::type);
425-
CV_DbgAssert(res.type() == WorkVec::type && res.size() == res.size());
424+
CV_DbgAssert(res.type() == traits::Type<WorkVec>::value);
425+
CV_DbgAssert(res.type() == traits::Type<WorkVec>::value && res.size() == res.size());
426426
}
427427

428428

@@ -470,7 +470,7 @@ template <typename GuideVec>
470470
DTFilterCPU::ComputeIDTHor_ParBody<GuideVec>::ComputeIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dst_)
471471
: dtf(dtf_), guide(guide_), dst(dst_)
472472
{
473-
dst.create(guide.rows, guide.cols + 1, IDistVec::type);
473+
dst.create(guide.rows, guide.cols + 1, traits::Type<IDistVec>::value);
474474
}
475475

476476
template <typename GuideVec>
@@ -497,8 +497,8 @@ template <typename GuideVec>
497497
DTFilterCPU::ComputeDTandIDTHor_ParBody<GuideVec>::ComputeDTandIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dist_, Mat& idist_)
498498
: dtf(dtf_), guide(guide_), dist(dist_), idist(idist_)
499499
{
500-
dist = getWExtendedMat(guide.rows, guide.cols, IDistVec::type, 1, 1);
501-
idist = getWExtendedMat(guide.rows, guide.cols + 1, IDistVec::type);
500+
dist = getWExtendedMat(guide.rows, guide.cols, traits::Type<IDistVec>::value, 1, 1);
501+
idist = getWExtendedMat(guide.rows, guide.cols + 1, traits::Type<IDistVec>::value);
502502
maxRadius = dtf.getIterRadius(1);
503503
}
504504

@@ -535,7 +535,7 @@ template <typename GuideVec>
535535
DTFilterCPU::ComputeA0DTHor_ParBody<GuideVec>::ComputeA0DTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_)
536536
: dtf(dtf_), guide(guide_)
537537
{
538-
dtf.a0distHor.create(guide.rows, guide.cols - 1, DistVec::type);
538+
dtf.a0distHor.create(guide.rows, guide.cols - 1, traits::Type<DistVec>::value);
539539
lna = std::log(dtf.getIterAlpha(1));
540540
}
541541

@@ -565,7 +565,7 @@ template <typename GuideVec>
565565
DTFilterCPU::ComputeA0DTVert_ParBody<GuideVec>::ComputeA0DTVert_ParBody(DTFilterCPU& dtf_, Mat& guide_)
566566
: dtf(dtf_), guide(guide_)
567567
{
568-
dtf.a0distVert.create(guide.rows - 1, guide.cols, DistVec::type);
568+
dtf.a0distVert.create(guide.rows - 1, guide.cols, traits::Type<DistVec>::value);
569569
lna = std::log(dtf.getIterAlpha(1));
570570
}
571571

0 commit comments

Comments
 (0)