Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
b556c2a7
Commit
b556c2a7
authored
Aug 24, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: migrate to traits::Type / traits::Depth
parent
62e77e99
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
37 deletions
+37
-37
simpleflow.cpp
modules/optflow/src/simpleflow.cpp
+1
-1
dtfilter_cpu.inl.hpp
modules/ximgproc/src/dtfilter_cpu.inl.hpp
+23
-23
fgs_filter.cpp
modules/ximgproc/src/fgs_filter.cpp
+7
-7
joint_bilateral_filter.cpp
modules/ximgproc/src/joint_bilateral_filter.cpp
+2
-2
test_domain_transform.cpp
modules/ximgproc/test/test_domain_transform.cpp
+1
-1
test_joint_bilateral_filter.cpp
modules/ximgproc/test/test_joint_bilateral_filter.cpp
+1
-1
test_structured_edge_detection.cpp
modules/ximgproc/test/test_structured_edge_detection.cpp
+2
-2
No files found.
modules/optflow/src/simpleflow.cpp
View file @
b556c2a7
...
@@ -131,7 +131,7 @@ public:
...
@@ -131,7 +131,7 @@ public:
flag
(
flag_
),
flag
(
flag_
),
spaceWeights
(
spaceWeights_
),
spaceWeights
(
spaceWeights_
),
expLut
(
expLut_
)
{
expLut
(
expLut_
)
{
CV_DbgAssert
(
joint
.
type
()
==
JointVec
::
type
&&
confidence
.
type
()
==
CV_32F
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
SrcVec
::
typ
e
);
CV_DbgAssert
(
joint
.
type
()
==
traits
::
Type
<
JointVec
>::
value
&&
confidence
.
type
()
==
CV_32F
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
traits
::
Type
<
SrcVec
>::
valu
e
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
confidence
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
confidence
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
confidence
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
confidence
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
}
}
...
...
modules/ximgproc/src/dtfilter_cpu.inl.hpp
View file @
b556c2a7
...
@@ -69,7 +69,7 @@ DTFilterCPU* DTFilterCPU::create_p_(const Mat& guide, double sigmaSpatial, doubl
...
@@ -69,7 +69,7 @@ DTFilterCPU* DTFilterCPU::create_p_(const Mat& guide, double sigmaSpatial, doubl
template
<
typename
GuideVec
>
template
<
typename
GuideVec
>
void
DTFilterCPU
::
init_
(
Mat
&
guide
,
double
sigmaSpatial_
,
double
sigmaColor_
,
int
mode_
,
int
numIters_
)
void
DTFilterCPU
::
init_
(
Mat
&
guide
,
double
sigmaSpatial_
,
double
sigmaColor_
,
int
mode_
,
int
numIters_
)
{
{
CV_Assert
(
guide
.
type
()
==
cv
::
DataType
<
GuideVec
>::
typ
e
);
CV_Assert
(
guide
.
type
()
==
traits
::
Type
<
GuideVec
>::
valu
e
);
this
->
release
();
this
->
release
();
...
@@ -123,7 +123,7 @@ template <typename SrcVec>
...
@@ -123,7 +123,7 @@ template <typename SrcVec>
void
DTFilterCPU
::
filter_
(
const
Mat
&
src
,
Mat
&
dst
,
int
dDepth
)
void
DTFilterCPU
::
filter_
(
const
Mat
&
src
,
Mat
&
dst
,
int
dDepth
)
{
{
typedef
typename
DataType
<
Vec
<
WorkType
,
SrcVec
::
channels
>
>::
vec_type
WorkVec
;
typedef
typename
DataType
<
Vec
<
WorkType
,
SrcVec
::
channels
>
>::
vec_type
WorkVec
;
CV_Assert
(
src
.
type
()
==
SrcVec
::
typ
e
);
CV_Assert
(
src
.
type
()
==
traits
::
Type
<
SrcVec
>::
valu
e
);
if
(
src
.
cols
!=
w
||
src
.
rows
!=
h
)
if
(
src
.
cols
!=
w
||
src
.
rows
!=
h
)
{
{
CV_Error
(
Error
::
StsBadSize
,
"Size of filtering image must be equal to size of guide image"
);
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,17 +139,17 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
if
(
dDepth
==
-
1
)
dDepth
=
src
.
depth
();
if
(
dDepth
==
-
1
)
dDepth
=
src
.
depth
();
//small optimization to avoid extra copying of data
//small optimization to avoid extra copying of data
bool
useDstAsRes
=
(
dDepth
==
WorkVec
::
depth
&&
(
mode
==
DTF_NC
||
mode
==
DTF_RF
));
bool
useDstAsRes
=
(
dDepth
==
traits
::
Depth
<
WorkVec
>::
value
&&
(
mode
==
DTF_NC
||
mode
==
DTF_RF
));
if
(
useDstAsRes
)
if
(
useDstAsRes
)
{
{
dst
.
create
(
h
,
w
,
WorkVec
::
typ
e
);
dst
.
create
(
h
,
w
,
traits
::
Type
<
WorkVec
>::
valu
e
);
res
=
dst
;
res
=
dst
;
}
}
if
(
mode
==
DTF_NC
)
if
(
mode
==
DTF_NC
)
{
{
Mat
resT
(
src
.
cols
,
src
.
rows
,
WorkVec
::
typ
e
);
Mat
resT
(
src
.
cols
,
src
.
rows
,
traits
::
Type
<
WorkVec
>::
valu
e
);
src
.
convertTo
(
res
,
WorkVec
::
typ
e
);
src
.
convertTo
(
res
,
traits
::
Type
<
WorkVec
>::
valu
e
);
FilterNC_horPass
<
WorkVec
>
horParBody
(
res
,
idistHor
,
resT
);
FilterNC_horPass
<
WorkVec
>
horParBody
(
res
,
idistHor
,
resT
);
FilterNC_horPass
<
WorkVec
>
vertParBody
(
resT
,
idistVert
,
res
);
FilterNC_horPass
<
WorkVec
>
vertParBody
(
resT
,
idistVert
,
res
);
...
@@ -180,7 +180,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
...
@@ -180,7 +180,7 @@ void DTFilterCPU::filter_(const Mat& src, Mat& dst, int dDepth)
}
}
else
if
(
mode
==
DTF_RF
)
else
if
(
mode
==
DTF_RF
)
{
{
src
.
convertTo
(
res
,
WorkVec
::
typ
e
);
src
.
convertTo
(
res
,
traits
::
Type
<
WorkVec
>::
valu
e
);
for
(
int
iter
=
1
;
iter
<=
numIters
;
iter
++
)
for
(
int
iter
=
1
;
iter
<=
numIters
;
iter
++
)
{
{
...
@@ -237,13 +237,13 @@ void DTFilterCPU::integrateSparseRow(const SrcVec *src, const float *dist, SrcWo
...
@@ -237,13 +237,13 @@ void DTFilterCPU::integrateSparseRow(const SrcVec *src, const float *dist, SrcWo
template
<
typename
WorkVec
>
template
<
typename
WorkVec
>
void
DTFilterCPU
::
prepareSrcImg_IC
(
const
Mat
&
src
,
Mat
&
dst
,
Mat
&
dstT
)
void
DTFilterCPU
::
prepareSrcImg_IC
(
const
Mat
&
src
,
Mat
&
dst
,
Mat
&
dstT
)
{
{
Mat
dstOut
(
src
.
rows
,
src
.
cols
+
2
,
WorkVec
::
typ
e
);
Mat
dstOut
(
src
.
rows
,
src
.
cols
+
2
,
traits
::
Type
<
WorkVec
>::
valu
e
);
Mat
dstOutT
(
src
.
cols
,
src
.
rows
+
2
,
WorkVec
::
typ
e
);
Mat
dstOutT
(
src
.
cols
,
src
.
rows
+
2
,
traits
::
Type
<
WorkVec
>::
valu
e
);
dst
=
dstOut
(
Range
::
all
(),
Range
(
1
,
src
.
cols
+
1
));
dst
=
dstOut
(
Range
::
all
(),
Range
(
1
,
src
.
cols
+
1
));
dstT
=
dstOutT
(
Range
::
all
(),
Range
(
1
,
src
.
rows
+
1
));
dstT
=
dstOutT
(
Range
::
all
(),
Range
(
1
,
src
.
rows
+
1
));
src
.
convertTo
(
dst
,
WorkVec
::
typ
e
);
src
.
convertTo
(
dst
,
traits
::
Type
<
WorkVec
>::
valu
e
);
WorkVec
*
line
;
WorkVec
*
line
;
int
ri
=
dstOut
.
cols
-
1
;
int
ri
=
dstOut
.
cols
-
1
;
...
@@ -270,7 +270,7 @@ template <typename WorkVec>
...
@@ -270,7 +270,7 @@ template <typename WorkVec>
DTFilterCPU
::
FilterNC_horPass
<
WorkVec
>::
FilterNC_horPass
(
Mat
&
src_
,
Mat
&
idist_
,
Mat
&
dst_
)
DTFilterCPU
::
FilterNC_horPass
<
WorkVec
>::
FilterNC_horPass
(
Mat
&
src_
,
Mat
&
idist_
,
Mat
&
dst_
)
:
src
(
src_
),
idist
(
idist_
),
dst
(
dst_
),
radius
(
1.0
f
)
:
src
(
src_
),
idist
(
idist_
),
dst
(
dst_
),
radius
(
1.0
f
)
{
{
CV_DbgAssert
(
src
.
type
()
==
WorkVec
::
type
&&
dst
.
type
()
==
WorkVec
::
typ
e
&&
dst
.
rows
==
src
.
cols
&&
dst
.
cols
==
src
.
rows
);
CV_DbgAssert
(
src
.
type
()
==
traits
::
Type
<
WorkVec
>::
value
&&
dst
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
&&
dst
.
rows
==
src
.
cols
&&
dst
.
cols
==
src
.
rows
);
}
}
template
<
typename
WorkVec
>
template
<
typename
WorkVec
>
...
@@ -324,12 +324,12 @@ template <typename WorkVec>
...
@@ -324,12 +324,12 @@ template <typename WorkVec>
DTFilterCPU
::
FilterIC_horPass
<
WorkVec
>::
FilterIC_horPass
(
Mat
&
src_
,
Mat
&
idist_
,
Mat
&
dist_
,
Mat
&
dst_
)
DTFilterCPU
::
FilterIC_horPass
<
WorkVec
>::
FilterIC_horPass
(
Mat
&
src_
,
Mat
&
idist_
,
Mat
&
dist_
,
Mat
&
dst_
)
:
src
(
src_
),
idist
(
idist_
),
dist
(
dist_
),
dst
(
dst_
),
radius
(
1.0
f
)
:
src
(
src_
),
idist
(
idist_
),
dist
(
dist_
),
dst
(
dst_
),
radius
(
1.0
f
)
{
{
CV_DbgAssert
(
src
.
type
()
==
WorkVec
::
type
&&
dst
.
type
()
==
WorkVec
::
typ
e
&&
dst
.
rows
==
src
.
cols
&&
dst
.
cols
==
src
.
rows
);
CV_DbgAssert
(
src
.
type
()
==
traits
::
Type
<
WorkVec
>::
value
&&
dst
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
&&
dst
.
rows
==
src
.
cols
&&
dst
.
cols
==
src
.
rows
);
#ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY
#ifdef CV_GET_NUM_THREAD_WORKS_PROPERLY
isrcBuf
.
create
(
cv
::
getNumThreads
(),
src
.
cols
+
1
,
WorkVec
::
typ
e
);
isrcBuf
.
create
(
cv
::
getNumThreads
(),
src
.
cols
+
1
,
traits
::
Type
<
WorkVec
>::
valu
e
);
#else
#else
isrcBuf
.
create
(
src
.
rows
,
src
.
cols
+
1
,
WorkVec
::
typ
e
);
isrcBuf
.
create
(
src
.
rows
,
src
.
cols
+
1
,
traits
::
Type
<
WorkVec
>::
valu
e
);
#endif
#endif
}
}
...
@@ -384,8 +384,8 @@ template <typename WorkVec>
...
@@ -384,8 +384,8 @@ template <typename WorkVec>
DTFilterCPU
::
FilterRF_horPass
<
WorkVec
>::
FilterRF_horPass
(
Mat
&
res_
,
Mat
&
alphaD_
,
int
iteration_
)
DTFilterCPU
::
FilterRF_horPass
<
WorkVec
>::
FilterRF_horPass
(
Mat
&
res_
,
Mat
&
alphaD_
,
int
iteration_
)
:
res
(
res_
),
alphaD
(
alphaD_
),
iteration
(
iteration_
)
:
res
(
res_
),
alphaD
(
alphaD_
),
iteration
(
iteration_
)
{
{
CV_DbgAssert
(
res
.
type
()
==
WorkVec
::
typ
e
);
CV_DbgAssert
(
res
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
);
CV_DbgAssert
(
res
.
type
()
==
WorkVec
::
typ
e
&&
res
.
size
()
==
res
.
size
());
CV_DbgAssert
(
res
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
&&
res
.
size
()
==
res
.
size
());
}
}
...
@@ -421,8 +421,8 @@ template <typename WorkVec>
...
@@ -421,8 +421,8 @@ template <typename WorkVec>
DTFilterCPU
::
FilterRF_vertPass
<
WorkVec
>::
FilterRF_vertPass
(
Mat
&
res_
,
Mat
&
alphaD_
,
int
iteration_
)
DTFilterCPU
::
FilterRF_vertPass
<
WorkVec
>::
FilterRF_vertPass
(
Mat
&
res_
,
Mat
&
alphaD_
,
int
iteration_
)
:
res
(
res_
),
alphaD
(
alphaD_
),
iteration
(
iteration_
)
:
res
(
res_
),
alphaD
(
alphaD_
),
iteration
(
iteration_
)
{
{
CV_DbgAssert
(
res
.
type
()
==
WorkVec
::
typ
e
);
CV_DbgAssert
(
res
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
);
CV_DbgAssert
(
res
.
type
()
==
WorkVec
::
typ
e
&&
res
.
size
()
==
res
.
size
());
CV_DbgAssert
(
res
.
type
()
==
traits
::
Type
<
WorkVec
>::
valu
e
&&
res
.
size
()
==
res
.
size
());
}
}
...
@@ -470,7 +470,7 @@ template <typename GuideVec>
...
@@ -470,7 +470,7 @@ template <typename GuideVec>
DTFilterCPU
::
ComputeIDTHor_ParBody
<
GuideVec
>::
ComputeIDTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
,
Mat
&
dst_
)
DTFilterCPU
::
ComputeIDTHor_ParBody
<
GuideVec
>::
ComputeIDTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
,
Mat
&
dst_
)
:
dtf
(
dtf_
),
guide
(
guide_
),
dst
(
dst_
)
:
dtf
(
dtf_
),
guide
(
guide_
),
dst
(
dst_
)
{
{
dst
.
create
(
guide
.
rows
,
guide
.
cols
+
1
,
IDistVec
::
typ
e
);
dst
.
create
(
guide
.
rows
,
guide
.
cols
+
1
,
traits
::
Type
<
IDistVec
>::
valu
e
);
}
}
template
<
typename
GuideVec
>
template
<
typename
GuideVec
>
...
@@ -497,8 +497,8 @@ template <typename GuideVec>
...
@@ -497,8 +497,8 @@ template <typename GuideVec>
DTFilterCPU
::
ComputeDTandIDTHor_ParBody
<
GuideVec
>::
ComputeDTandIDTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
,
Mat
&
dist_
,
Mat
&
idist_
)
DTFilterCPU
::
ComputeDTandIDTHor_ParBody
<
GuideVec
>::
ComputeDTandIDTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
,
Mat
&
dist_
,
Mat
&
idist_
)
:
dtf
(
dtf_
),
guide
(
guide_
),
dist
(
dist_
),
idist
(
idist_
)
:
dtf
(
dtf_
),
guide
(
guide_
),
dist
(
dist_
),
idist
(
idist_
)
{
{
dist
=
getWExtendedMat
(
guide
.
rows
,
guide
.
cols
,
IDistVec
::
typ
e
,
1
,
1
);
dist
=
getWExtendedMat
(
guide
.
rows
,
guide
.
cols
,
traits
::
Type
<
IDistVec
>::
valu
e
,
1
,
1
);
idist
=
getWExtendedMat
(
guide
.
rows
,
guide
.
cols
+
1
,
IDistVec
::
typ
e
);
idist
=
getWExtendedMat
(
guide
.
rows
,
guide
.
cols
+
1
,
traits
::
Type
<
IDistVec
>::
valu
e
);
maxRadius
=
dtf
.
getIterRadius
(
1
);
maxRadius
=
dtf
.
getIterRadius
(
1
);
}
}
...
@@ -535,7 +535,7 @@ template <typename GuideVec>
...
@@ -535,7 +535,7 @@ template <typename GuideVec>
DTFilterCPU
::
ComputeA0DTHor_ParBody
<
GuideVec
>::
ComputeA0DTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
)
DTFilterCPU
::
ComputeA0DTHor_ParBody
<
GuideVec
>::
ComputeA0DTHor_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
)
:
dtf
(
dtf_
),
guide
(
guide_
)
:
dtf
(
dtf_
),
guide
(
guide_
)
{
{
dtf
.
a0distHor
.
create
(
guide
.
rows
,
guide
.
cols
-
1
,
DistVec
::
typ
e
);
dtf
.
a0distHor
.
create
(
guide
.
rows
,
guide
.
cols
-
1
,
traits
::
Type
<
DistVec
>::
valu
e
);
lna
=
std
::
log
(
dtf
.
getIterAlpha
(
1
));
lna
=
std
::
log
(
dtf
.
getIterAlpha
(
1
));
}
}
...
@@ -565,7 +565,7 @@ template <typename GuideVec>
...
@@ -565,7 +565,7 @@ template <typename GuideVec>
DTFilterCPU
::
ComputeA0DTVert_ParBody
<
GuideVec
>::
ComputeA0DTVert_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
)
DTFilterCPU
::
ComputeA0DTVert_ParBody
<
GuideVec
>::
ComputeA0DTVert_ParBody
(
DTFilterCPU
&
dtf_
,
Mat
&
guide_
)
:
dtf
(
dtf_
),
guide
(
guide_
)
:
dtf
(
dtf_
),
guide
(
guide_
)
{
{
dtf
.
a0distVert
.
create
(
guide
.
rows
-
1
,
guide
.
cols
,
DistVec
::
typ
e
);
dtf
.
a0distVert
.
create
(
guide
.
rows
-
1
,
guide
.
cols
,
traits
::
Type
<
DistVec
>::
valu
e
);
lna
=
std
::
log
(
dtf
.
getIterAlpha
(
1
));
lna
=
std
::
log
(
dtf
.
getIterAlpha
(
1
));
}
}
...
...
modules/ximgproc/src/fgs_filter.cpp
View file @
b556c2a7
...
@@ -148,16 +148,16 @@ void FastGlobalSmootherFilterImpl::init(InputArray guide,double _lambda,double _
...
@@ -148,16 +148,16 @@ void FastGlobalSmootherFilterImpl::init(InputArray guide,double _lambda,double _
num_iter
=
_num_iter
;
num_iter
=
_num_iter
;
num_stripes
=
getNumThreads
();
num_stripes
=
getNumThreads
();
int
num_levels
=
3
*
256
*
256
;
int
num_levels
=
3
*
256
*
256
;
weights_LUT
.
create
(
1
,
num_levels
,
WorkVec
::
typ
e
);
weights_LUT
.
create
(
1
,
num_levels
,
traits
::
Type
<
WorkVec
>::
valu
e
);
WorkType
*
LUT
=
(
WorkType
*
)
weights_LUT
.
ptr
(
0
);
WorkType
*
LUT
=
(
WorkType
*
)
weights_LUT
.
ptr
(
0
);
parallel_for_
(
Range
(
0
,
num_stripes
),
ComputeLUT_ParBody
(
*
this
,
LUT
,
num_stripes
,
num_levels
));
parallel_for_
(
Range
(
0
,
num_stripes
),
ComputeLUT_ParBody
(
*
this
,
LUT
,
num_stripes
,
num_levels
));
w
=
guide
.
cols
();
w
=
guide
.
cols
();
h
=
guide
.
rows
();
h
=
guide
.
rows
();
Chor
.
create
(
h
,
w
,
WorkVec
::
typ
e
);
Chor
.
create
(
h
,
w
,
traits
::
Type
<
WorkVec
>::
valu
e
);
Cvert
.
create
(
h
,
w
,
WorkVec
::
typ
e
);
Cvert
.
create
(
h
,
w
,
traits
::
Type
<
WorkVec
>::
valu
e
);
interD
.
create
(
h
,
w
,
WorkVec
::
typ
e
);
interD
.
create
(
h
,
w
,
traits
::
Type
<
WorkVec
>::
valu
e
);
Mat
guideMat
=
guide
.
getMat
();
Mat
guideMat
=
guide
.
getMat
();
if
(
guide
.
channels
()
==
1
)
if
(
guide
.
channels
()
==
1
)
...
@@ -201,8 +201,8 @@ void FastGlobalSmootherFilterImpl::filter(InputArray src, OutputArray dst)
...
@@ -201,8 +201,8 @@ void FastGlobalSmootherFilterImpl::filter(InputArray src, OutputArray dst)
{
{
lambda
=
lambda_ref
;
lambda
=
lambda_ref
;
Mat
cur_res
=
src_channels
[
i
].
clone
();
Mat
cur_res
=
src_channels
[
i
].
clone
();
if
(
src
.
depth
()
!=
WorkVec
::
typ
e
)
if
(
src
.
depth
()
!=
traits
::
Type
<
WorkVec
>::
valu
e
)
cur_res
.
convertTo
(
cur_res
,
WorkVec
::
typ
e
);
cur_res
.
convertTo
(
cur_res
,
traits
::
Type
<
WorkVec
>::
valu
e
);
for
(
int
n
=
0
;
n
<
num_iter
;
n
++
)
for
(
int
n
=
0
;
n
<
num_iter
;
n
++
)
{
{
...
@@ -212,7 +212,7 @@ void FastGlobalSmootherFilterImpl::filter(InputArray src, OutputArray dst)
...
@@ -212,7 +212,7 @@ void FastGlobalSmootherFilterImpl::filter(InputArray src, OutputArray dst)
}
}
Mat
dstMat
;
Mat
dstMat
;
if
(
src
.
depth
()
!=
WorkVec
::
typ
e
)
if
(
src
.
depth
()
!=
traits
::
Type
<
WorkVec
>::
valu
e
)
cur_res
.
convertTo
(
dstMat
,
src
.
depth
());
cur_res
.
convertTo
(
dstMat
,
src
.
depth
());
else
else
dstMat
=
cur_res
;
dstMat
=
cur_res
;
...
...
modules/ximgproc/src/joint_bilateral_filter.cpp
View file @
b556c2a7
...
@@ -77,7 +77,7 @@ public:
...
@@ -77,7 +77,7 @@ public:
joint
(
joint_
),
src
(
src_
),
dst
(
dst_
),
radius
(
radius_
),
maxk
(
maxk_
),
joint
(
joint_
),
src
(
src_
),
dst
(
dst_
),
radius
(
radius_
),
maxk
(
maxk_
),
scaleIndex
(
scaleIndex_
),
spaceOfs
(
spaceOfs_
),
spaceWeights
(
spaceWeights_
),
expLUT
(
expLUT_
)
scaleIndex
(
scaleIndex_
),
spaceOfs
(
spaceOfs_
),
spaceWeights
(
spaceWeights_
),
expLUT
(
expLUT_
)
{
{
CV_DbgAssert
(
joint
.
type
()
==
JointVec
::
type
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
SrcVec
::
typ
e
);
CV_DbgAssert
(
joint
.
type
()
==
traits
::
Type
<
JointVec
>::
value
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
traits
::
Type
<
SrcVec
>::
valu
e
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
}
}
...
@@ -223,7 +223,7 @@ public:
...
@@ -223,7 +223,7 @@ public:
joint
(
joint_
),
src
(
src_
),
dst
(
dst_
),
radius
(
radius_
),
maxk
(
maxk_
),
joint
(
joint_
),
src
(
src_
),
dst
(
dst_
),
radius
(
radius_
),
maxk
(
maxk_
),
spaceOfs
(
spaceOfs_
),
spaceWeights
(
spaceWeights_
),
expLUT
(
expLUT_
)
spaceOfs
(
spaceOfs_
),
spaceWeights
(
spaceWeights_
),
expLUT
(
expLUT_
)
{
{
CV_DbgAssert
(
joint
.
type
()
==
JointVec
::
type
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
SrcVec
::
typ
e
);
CV_DbgAssert
(
joint
.
type
()
==
traits
::
Type
<
JointVec
>::
value
&&
src
.
type
()
==
dst
.
type
()
&&
src
.
type
()
==
traits
::
Type
<
SrcVec
>::
valu
e
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
rows
==
src
.
rows
&&
src
.
rows
==
dst
.
rows
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
CV_DbgAssert
(
joint
.
cols
==
src
.
cols
&&
src
.
cols
==
dst
.
cols
+
2
*
radius
);
}
}
...
...
modules/ximgproc/test/test_domain_transform.cpp
View file @
b556c2a7
...
@@ -168,7 +168,7 @@ Mat getChessMat1px(Size sz, double whiteIntensity = 255)
...
@@ -168,7 +168,7 @@ Mat getChessMat1px(Size sz, double whiteIntensity = 255)
{
{
typedef
typename
DataType
<
SrcVec
>::
channel_type
SrcType
;
typedef
typename
DataType
<
SrcVec
>::
channel_type
SrcType
;
Mat
dst
(
sz
,
DataType
<
SrcVec
>::
typ
e
);
Mat
dst
(
sz
,
traits
::
Type
<
SrcVec
>::
valu
e
);
SrcVec
black
=
SrcVec
::
all
(
0
);
SrcVec
black
=
SrcVec
::
all
(
0
);
SrcVec
white
=
SrcVec
::
all
((
SrcType
)
whiteIntensity
);
SrcVec
white
=
SrcVec
::
all
((
SrcType
)
whiteIntensity
);
...
...
modules/ximgproc/test/test_joint_bilateral_filter.cpp
View file @
b556c2a7
...
@@ -113,7 +113,7 @@ template<typename JointVec, typename SrcVec>
...
@@ -113,7 +113,7 @@ template<typename JointVec, typename SrcVec>
void
jointBilateralFilterNaive_
(
InputArray
joint_
,
InputArray
src_
,
OutputArray
dst_
,
int
d
,
double
sigmaColor
,
double
sigmaSpace
,
int
borderType
)
void
jointBilateralFilterNaive_
(
InputArray
joint_
,
InputArray
src_
,
OutputArray
dst_
,
int
d
,
double
sigmaColor
,
double
sigmaSpace
,
int
borderType
)
{
{
CV_Assert
(
joint_
.
size
()
==
src_
.
size
());
CV_Assert
(
joint_
.
size
()
==
src_
.
size
());
CV_Assert
(
joint_
.
type
()
==
JointVec
::
type
&&
src_
.
type
()
==
SrcVec
::
typ
e
);
CV_Assert
(
joint_
.
type
()
==
traits
::
Type
<
JointVec
>::
value
&&
src_
.
type
()
==
traits
::
Type
<
SrcVec
>::
valu
e
);
typedef
Vec
<
float
,
SrcVec
::
channels
>
SrcVecf
;
typedef
Vec
<
float
,
SrcVec
::
channels
>
SrcVecf
;
if
(
sigmaColor
<=
0
)
if
(
sigmaColor
<=
0
)
...
...
modules/ximgproc/test/test_structured_edge_detection.cpp
View file @
b556c2a7
...
@@ -22,9 +22,9 @@ TEST(ximpgroc_StructuredEdgeDetection, regression)
...
@@ -22,9 +22,9 @@ TEST(ximpgroc_StructuredEdgeDetection, regression)
cv
::
String
previousResultName
=
dir
+
cv
::
format
(
"results/%02d.png"
,
i
+
1
);
cv
::
String
previousResultName
=
dir
+
cv
::
format
(
"results/%02d.png"
,
i
+
1
);
cv
::
Mat
previousResult
=
cv
::
imread
(
previousResultName
,
0
);
cv
::
Mat
previousResult
=
cv
::
imread
(
previousResultName
,
0
);
previousResult
.
convertTo
(
previousResult
,
cv
::
DataType
<
float
>::
type
,
1
/
255.0
);
previousResult
.
convertTo
(
previousResult
,
CV_32F
,
1
/
255.0
);
src
.
convertTo
(
src
,
cv
::
DataType
<
float
>::
type
,
1
/
255.0
);
src
.
convertTo
(
src
,
CV_32F
,
1
/
255.0
);
cv
::
Mat
currentResult
(
src
.
size
(),
src
.
type
()
);
cv
::
Mat
currentResult
(
src
.
size
(),
src
.
type
()
);
pDollar
->
detectEdges
(
src
,
currentResult
);
pDollar
->
detectEdges
(
src
,
currentResult
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment