Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
9c0f556d
Commit
9c0f556d
authored
Aug 03, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a few compile warnings and errors with VS2010.
parent
5b4297cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
smooth.cpp
modules/imgproc/src/smooth.cpp
+18
-19
test_bilateral_filter.cpp
modules/imgproc/test/test_bilateral_filter.cpp
+2
-2
No files found.
modules/imgproc/src/smooth.cpp
View file @
9c0f556d
...
...
@@ -1292,22 +1292,22 @@ class BilateralFilter_8u_Invoker :
public
ParallelLoopBody
{
public
:
BilateralFilter_8u_Invoker
(
const
Mat
&
_src
,
Mat
&
_dst
,
Mat
_temp
,
int
_radius
,
int
_maxk
,
BilateralFilter_8u_Invoker
(
Mat
&
_dest
,
const
Mat
&
_temp
,
int
_radius
,
int
_maxk
,
int
*
_space_ofs
,
float
*
_space_weight
,
float
*
_color_weight
)
:
ParallelLoopBody
(),
src
(
_src
),
dst
(
_dst
),
temp
(
_temp
),
radius
(
_radius
),
ParallelLoopBody
(),
dest
(
&
_dest
),
temp
(
&
_temp
),
radius
(
_radius
),
maxk
(
_maxk
),
space_ofs
(
_space_ofs
),
space_weight
(
_space_weight
),
color_weight
(
_color_weight
)
{
}
virtual
void
operator
()
(
const
Range
&
range
)
const
{
int
i
,
j
,
cn
=
src
.
channels
(),
k
;
Size
size
=
src
.
size
();
int
i
,
j
,
cn
=
dest
->
channels
(),
k
;
Size
size
=
dest
->
size
();
for
(
i
=
range
.
start
;
i
<
range
.
end
;
i
++
)
{
const
uchar
*
sptr
=
temp
.
data
+
(
i
+
radius
)
*
temp
.
step
+
radius
*
cn
;
uchar
*
dptr
=
d
st
.
data
+
i
*
dst
.
step
;
const
uchar
*
sptr
=
temp
->
ptr
(
i
+
radius
)
+
radius
*
cn
;
uchar
*
dptr
=
d
est
->
ptr
(
i
)
;
if
(
cn
==
1
)
{
...
...
@@ -1353,9 +1353,9 @@ public:
}
private
:
const
Mat
&
src
;
Mat
&
dst
,
temp
;
int
radius
,
maxk
,
*
space_ofs
;
const
Mat
*
temp
;
Mat
*
dest
;
int
radius
,
maxk
,
*
space_ofs
;
float
*
space_weight
,
*
color_weight
;
};
...
...
@@ -1412,7 +1412,7 @@ bilateralFilter_8u( const Mat& src, Mat& dst, int d,
space_ofs
[
maxk
++
]
=
(
int
)(
i
*
temp
.
step
+
j
*
cn
);
}
BilateralFilter_8u_Invoker
body
(
src
,
dst
,
temp
,
radius
,
maxk
,
space_ofs
,
space_weight
,
color_weight
);
BilateralFilter_8u_Invoker
body
(
dst
,
temp
,
radius
,
maxk
,
space_ofs
,
space_weight
,
color_weight
);
parallel_for_
(
Range
(
0
,
size
.
height
),
body
);
}
...
...
@@ -1423,22 +1423,21 @@ class BilateralFilter_32f_Invoker :
public
:
BilateralFilter_32f_Invoker
(
int
_cn
,
int
_radius
,
int
_maxk
,
int
*
_space_ofs
,
Mat
_temp
,
Mat
*
_dest
,
Size
_size
,
float
_scale_index
,
float
*
_space_weight
,
float
*
_expLUT
)
:
const
Mat
&
_temp
,
Mat
&
_dest
,
float
_scale_index
,
float
*
_space_weight
,
float
*
_expLUT
)
:
ParallelLoopBody
(),
cn
(
_cn
),
radius
(
_radius
),
maxk
(
_maxk
),
space_ofs
(
_space_ofs
),
temp
(
_temp
),
dest
(
_dest
),
size
(
_size
),
scale_index
(
_scale_index
),
space_weight
(
_space_weight
),
expLUT
(
_expLUT
)
temp
(
&
_temp
),
dest
(
&
_dest
),
scale_index
(
_scale_index
),
space_weight
(
_space_weight
),
expLUT
(
_expLUT
)
{
}
virtual
void
operator
()
(
const
Range
&
range
)
const
{
Mat
&
dst
=
*
dest
;
int
i
,
j
,
k
;
Size
size
=
dest
->
size
();
for
(
i
=
range
.
start
;
i
<
range
.
end
;
i
++
)
{
const
float
*
sptr
=
(
const
float
*
)(
temp
.
data
+
(
i
+
radius
)
*
temp
.
step
)
+
radius
*
cn
;
float
*
dptr
=
(
float
*
)(
dst
.
data
+
i
*
dst
.
step
);
const
float
*
sptr
=
temp
->
ptr
<
float
>
(
i
+
radius
)
+
radius
*
cn
;
float
*
dptr
=
dest
->
ptr
<
float
>
(
i
);
if
(
cn
==
1
)
{
...
...
@@ -1490,8 +1489,8 @@ public:
private
:
int
cn
,
radius
,
maxk
,
*
space_ofs
;
Mat
temp
,
*
dest
;
Size
size
;
const
Mat
*
temp
;
Mat
*
dest
;
float
scale_index
,
*
space_weight
,
*
expLUT
;
};
...
...
@@ -1581,7 +1580,7 @@ bilateralFilter_32f( const Mat& src, Mat& dst, int d,
// parallel_for usage
BilateralFilter_32f_Invoker
body
(
cn
,
radius
,
maxk
,
space_ofs
,
temp
,
&
dst
,
size
,
scale_index
,
space_weight
,
expLUT
);
BilateralFilter_32f_Invoker
body
(
cn
,
radius
,
maxk
,
space_ofs
,
temp
,
dst
,
scale_index
,
space_weight
,
expLUT
);
parallel_for_
(
Range
(
0
,
size
.
height
),
body
);
}
...
...
modules/imgproc/test/test_bilateral_filter.cpp
View file @
9c0f556d
...
...
@@ -90,8 +90,8 @@ namespace cvtest
int
CV_BilateralFilterTest
::
getRandInt
(
RNG
&
rng
,
int
min_value
,
int
max_value
)
const
{
double
rand_value
=
rng
.
uniform
(
log
(
min_value
),
log
(
max_value
+
1
));
return
cvRound
(
exp
(
rand_value
));
double
rand_value
=
rng
.
uniform
(
log
(
(
double
)
min_value
),
log
((
double
)
max_value
+
1
));
return
cvRound
(
exp
(
(
double
)
rand_value
));
}
void
CV_BilateralFilterTest
::
reference_bilateral_filter
(
const
Mat
&
src
,
Mat
&
dst
,
int
d
,
...
...
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