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
bd1d7cd2
Commit
bd1d7cd2
authored
May 14, 2013
by
Vadim Pisarevsky
Committed by
OpenCV Buildbot
May 14, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #839 from pengx17:2.4_ocl_csbp
parents
87765c0f
9cfa24e5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
0 deletions
+98
-0
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+38
-0
stereocsbp.cl
modules/ocl/src/opencl/stereocsbp.cl
+0
-0
stereo_csbp.cpp
modules/ocl/src/stereo_csbp.cpp
+0
-0
test_calib3d.cpp
modules/ocl/test/test_calib3d.cpp
+60
-0
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
bd1d7cd2
...
@@ -1769,6 +1769,44 @@ namespace cv
...
@@ -1769,6 +1769,44 @@ namespace cv
std
::
vector
<
oclMat
>
datas
;
std
::
vector
<
oclMat
>
datas
;
oclMat
out
;
oclMat
out
;
};
};
class
CV_EXPORTS
StereoConstantSpaceBP
{
public
:
enum
{
DEFAULT_NDISP
=
128
};
enum
{
DEFAULT_ITERS
=
8
};
enum
{
DEFAULT_LEVELS
=
4
};
enum
{
DEFAULT_NR_PLANE
=
4
};
static
void
estimateRecommendedParams
(
int
width
,
int
height
,
int
&
ndisp
,
int
&
iters
,
int
&
levels
,
int
&
nr_plane
);
explicit
StereoConstantSpaceBP
(
int
ndisp
=
DEFAULT_NDISP
,
int
iters
=
DEFAULT_ITERS
,
int
levels
=
DEFAULT_LEVELS
,
int
nr_plane
=
DEFAULT_NR_PLANE
,
int
msg_type
=
CV_32F
);
StereoConstantSpaceBP
(
int
ndisp
,
int
iters
,
int
levels
,
int
nr_plane
,
float
max_data_term
,
float
data_weight
,
float
max_disc_term
,
float
disc_single_jump
,
int
min_disp_th
=
0
,
int
msg_type
=
CV_32F
);
void
operator
()(
const
oclMat
&
left
,
const
oclMat
&
right
,
oclMat
&
disparity
);
int
ndisp
;
int
iters
;
int
levels
;
int
nr_plane
;
float
max_data_term
;
float
data_weight
;
float
max_disc_term
;
float
disc_single_jump
;
int
min_disp_th
;
int
msg_type
;
bool
use_local_init_data_cost
;
private
:
oclMat
u
[
2
],
d
[
2
],
l
[
2
],
r
[
2
];
oclMat
disp_selected_pyr
[
2
];
oclMat
data_cost
;
oclMat
data_cost_selected
;
oclMat
temp
;
oclMat
out
;
};
}
}
}
}
#if defined _MSC_VER && _MSC_VER >= 1200
#if defined _MSC_VER && _MSC_VER >= 1200
...
...
modules/ocl/src/opencl/stereocsbp.cl
0 → 100644
View file @
bd1d7cd2
This diff is collapsed.
Click to expand it.
modules/ocl/src/stereo_csbp.cpp
0 → 100644
View file @
bd1d7cd2
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_calib3d.cpp
View file @
bd1d7cd2
...
@@ -134,4 +134,64 @@ TEST_P(StereoMatchBP, Regression)
...
@@ -134,4 +134,64 @@ TEST_P(StereoMatchBP, Regression)
INSTANTIATE_TEST_CASE_P
(
OCL_Calib3D
,
StereoMatchBP
,
testing
::
Combine
(
testing
::
Values
(
64
),
INSTANTIATE_TEST_CASE_P
(
OCL_Calib3D
,
StereoMatchBP
,
testing
::
Combine
(
testing
::
Values
(
64
),
testing
::
Values
(
8
),
testing
::
Values
(
2
),
testing
::
Values
(
25.0
f
),
testing
::
Values
(
8
),
testing
::
Values
(
2
),
testing
::
Values
(
25.0
f
),
testing
::
Values
(
0.1
f
),
testing
::
Values
(
15.0
f
),
testing
::
Values
(
1.0
f
)));
testing
::
Values
(
0.1
f
),
testing
::
Values
(
15.0
f
),
testing
::
Values
(
1.0
f
)));
//////////////////////////////////////////////////////////////////////////
// ConstSpaceBeliefPropagation
PARAM_TEST_CASE
(
StereoMatchConstSpaceBP
,
int
,
int
,
int
,
int
,
float
,
float
,
float
,
float
,
int
,
int
)
{
int
ndisp_
;
int
iters_
;
int
levels_
;
int
nr_plane_
;
float
max_data_term_
;
float
data_weight_
;
float
max_disc_term_
;
float
disc_single_jump_
;
int
min_disp_th_
;
int
msg_type_
;
virtual
void
SetUp
()
{
ndisp_
=
GET_PARAM
(
0
);
iters_
=
GET_PARAM
(
1
);
levels_
=
GET_PARAM
(
2
);
nr_plane_
=
GET_PARAM
(
3
);
max_data_term_
=
GET_PARAM
(
4
);
data_weight_
=
GET_PARAM
(
5
);
max_disc_term_
=
GET_PARAM
(
6
);
disc_single_jump_
=
GET_PARAM
(
7
);
min_disp_th_
=
GET_PARAM
(
8
);
msg_type_
=
GET_PARAM
(
9
);
}
};
TEST_P
(
StereoMatchConstSpaceBP
,
Regression
)
{
Mat
left_image
=
readImage
(
"csstereobp/aloe-L.png"
);
Mat
right_image
=
readImage
(
"csstereobp/aloe-R.png"
);
Mat
disp_gold
=
readImage
(
"csstereobp/aloe-disp.png"
,
IMREAD_GRAYSCALE
);
ocl
::
oclMat
d_left
,
d_right
;
ocl
::
oclMat
d_disp
;
Mat
disp
;
ASSERT_FALSE
(
left_image
.
empty
());
ASSERT_FALSE
(
right_image
.
empty
());
ASSERT_FALSE
(
disp_gold
.
empty
());
d_left
.
upload
(
left_image
);
d_right
.
upload
(
right_image
);
ocl
::
StereoConstantSpaceBP
bp
(
ndisp_
,
iters_
,
levels_
,
nr_plane_
,
max_data_term_
,
data_weight_
,
max_disc_term_
,
disc_single_jump_
,
0
,
CV_32F
);
bp
(
d_left
,
d_right
,
d_disp
);
d_disp
.
download
(
disp
);
disp
.
convertTo
(
disp
,
disp_gold
.
depth
());
EXPECT_MAT_SIMILAR
(
disp_gold
,
disp
,
1e-4
);
//EXPECT_MAT_NEAR(disp_gold, disp, 1.0, "");
}
INSTANTIATE_TEST_CASE_P
(
OCL_Calib3D
,
StereoMatchConstSpaceBP
,
testing
::
Combine
(
testing
::
Values
(
128
),
testing
::
Values
(
16
),
testing
::
Values
(
4
),
testing
::
Values
(
4
),
testing
::
Values
(
30.0
f
),
testing
::
Values
(
1.0
f
),
testing
::
Values
(
160.0
f
),
testing
::
Values
(
10.0
f
),
testing
::
Values
(
0
),
testing
::
Values
(
CV_32F
)));
#endif // HAVE_OPENCL
#endif // HAVE_OPENCL
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