@@ -69,7 +69,7 @@ DTFilterCPU* DTFilterCPU::create_p_(const Mat& guide, double sigmaSpatial, doubl
69
69
template <typename GuideVec>
70
70
void DTFilterCPU::init_ (Mat& guide, double sigmaSpatial_, double sigmaColor_, int mode_, int numIters_)
71
71
{
72
- CV_Assert (guide.type () == cv::DataType <GuideVec>::type );
72
+ CV_Assert (guide.type () == traits::Type <GuideVec>::value );
73
73
74
74
this ->release ();
75
75
@@ -123,7 +123,7 @@ template <typename SrcVec>
123
123
void DTFilterCPU::filter_ (const Mat& src, Mat& dst, int dDepth)
124
124
{
125
125
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 );
127
127
if ( src.cols != w || src.rows != h )
128
128
{
129
129
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)
139
139
if (dDepth == -1 ) dDepth = src.depth ();
140
140
141
141
// 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));
143
143
if (useDstAsRes)
144
144
{
145
- dst.create (h, w, WorkVec::type );
145
+ dst.create (h, w, traits::Type< WorkVec>::value );
146
146
res = dst;
147
147
}
148
148
149
149
if (mode == DTF_NC)
150
150
{
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 );
153
153
154
154
FilterNC_horPass<WorkVec> horParBody (res, idistHor, resT);
155
155
FilterNC_horPass<WorkVec> vertParBody (resT, idistVert, res);
@@ -180,7 +180,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
180
180
}
181
181
else if (mode == DTF_RF)
182
182
{
183
- src.convertTo (res, WorkVec::type );
183
+ src.convertTo (res, traits::Type< WorkVec>::value );
184
184
185
185
for (int iter = 1 ; iter <= numIters; iter++)
186
186
{
@@ -237,13 +237,13 @@ void DTFilterCPU::integrateSparseRow(const SrcVec *src, const float *dist, SrcWo
237
237
template <typename WorkVec>
238
238
void DTFilterCPU::prepareSrcImg_IC (const Mat& src, Mat& dst, Mat& dstT)
239
239
{
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 );
242
242
243
243
dst = dstOut (Range::all (), Range (1 , src.cols +1 ));
244
244
dstT = dstOutT (Range::all (), Range (1 , src.rows +1 ));
245
245
246
- src.convertTo (dst, WorkVec::type );
246
+ src.convertTo (dst, traits::Type< WorkVec>::value );
247
247
248
248
WorkVec *line;
249
249
int ri = dstOut.cols - 1 ;
@@ -270,7 +270,7 @@ template <typename WorkVec>
270
270
DTFilterCPU::FilterNC_horPass<WorkVec>::FilterNC_horPass(Mat& src_, Mat& idist_, Mat& dst_)
271
271
: src(src_), idist(idist_), dst(dst_), radius(1 .0f )
272
272
{
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 );
274
274
}
275
275
276
276
template <typename WorkVec>
@@ -324,12 +324,12 @@ template <typename WorkVec>
324
324
DTFilterCPU::FilterIC_horPass<WorkVec>::FilterIC_horPass(Mat& src_, Mat& idist_, Mat& dist_, Mat& dst_)
325
325
: src(src_), idist(idist_), dist(dist_), dst(dst_), radius(1 .0f )
326
326
{
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 );
328
328
329
329
#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 );
331
331
#else
332
- isrcBuf.create (src.rows , src.cols + 1 , WorkVec::type );
332
+ isrcBuf.create (src.rows , src.cols + 1 , traits::Type< WorkVec>::value );
333
333
#endif
334
334
}
335
335
@@ -384,8 +384,8 @@ template <typename WorkVec>
384
384
DTFilterCPU::FilterRF_horPass<WorkVec>::FilterRF_horPass(Mat& res_, Mat& alphaD_, int iteration_)
385
385
: res(res_), alphaD(alphaD_), iteration(iteration_)
386
386
{
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 ());
389
389
}
390
390
391
391
@@ -421,8 +421,8 @@ template <typename WorkVec>
421
421
DTFilterCPU::FilterRF_vertPass<WorkVec>::FilterRF_vertPass(Mat& res_, Mat& alphaD_, int iteration_)
422
422
: res(res_), alphaD(alphaD_), iteration(iteration_)
423
423
{
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 ());
426
426
}
427
427
428
428
@@ -470,7 +470,7 @@ template <typename GuideVec>
470
470
DTFilterCPU::ComputeIDTHor_ParBody<GuideVec>::ComputeIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dst_)
471
471
: dtf(dtf_), guide(guide_), dst(dst_)
472
472
{
473
- dst.create (guide.rows , guide.cols + 1 , IDistVec::type );
473
+ dst.create (guide.rows , guide.cols + 1 , traits::Type< IDistVec>::value );
474
474
}
475
475
476
476
template <typename GuideVec>
@@ -497,8 +497,8 @@ template <typename GuideVec>
497
497
DTFilterCPU::ComputeDTandIDTHor_ParBody<GuideVec>::ComputeDTandIDTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_, Mat& dist_, Mat& idist_)
498
498
: dtf(dtf_), guide(guide_), dist(dist_), idist(idist_)
499
499
{
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 );
502
502
maxRadius = dtf.getIterRadius (1 );
503
503
}
504
504
@@ -535,7 +535,7 @@ template <typename GuideVec>
535
535
DTFilterCPU::ComputeA0DTHor_ParBody<GuideVec>::ComputeA0DTHor_ParBody(DTFilterCPU& dtf_, Mat& guide_)
536
536
: dtf(dtf_), guide(guide_)
537
537
{
538
- dtf.a0distHor .create (guide.rows , guide.cols - 1 , DistVec::type );
538
+ dtf.a0distHor .create (guide.rows , guide.cols - 1 , traits::Type< DistVec>::value );
539
539
lna = std::log (dtf.getIterAlpha (1 ));
540
540
}
541
541
@@ -565,7 +565,7 @@ template <typename GuideVec>
565
565
DTFilterCPU::ComputeA0DTVert_ParBody<GuideVec>::ComputeA0DTVert_ParBody(DTFilterCPU& dtf_, Mat& guide_)
566
566
: dtf(dtf_), guide(guide_)
567
567
{
568
- dtf.a0distVert .create (guide.rows - 1 , guide.cols , DistVec::type );
568
+ dtf.a0distVert .create (guide.rows - 1 , guide.cols , traits::Type< DistVec>::value );
569
569
lna = std::log (dtf.getIterAlpha (1 ));
570
570
}
571
571
0 commit comments