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
788ac96f
Commit
788ac96f
authored
Aug 02, 2010
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added optimized belief propagation implementation (used short for messages)
parent
d6bbaea2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+26
-10
beliefpropagation_gpu.cpp
modules/gpu/src/beliefpropagation_gpu.cpp
+0
-0
beliefpropagation.cu
modules/gpu/src/cuda/beliefpropagation.cu
+0
-0
saturate_cast.hpp
modules/gpu/src/cuda/saturate_cast.hpp
+5
-0
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
788ac96f
...
...
@@ -375,20 +375,32 @@ namespace cv
class
CV_EXPORTS
StereoBeliefPropagation_GPU
{
public
:
enum
{
MSG_TYPE_AUTO
,
MSG_TYPE_FLOAT
,
MSG_TYPE_SHORT_SCALE_AUTO
,
MSG_TYPE_SHORT_SCALE_MANUAL
};
enum
{
DEFAULT_NDISP
=
64
};
enum
{
DEFAULT_ITERS
=
5
};
enum
{
DEFAULT_LEVELS
=
5
};
//! the default constructor
explicit
StereoBeliefPropagation_GPU
(
int
ndisp
=
DEFAULT_NDISP
,
int
iters
=
DEFAULT_ITERS
,
int
levels
=
DEFAULT_LEVELS
);
//! the full constructor taking the number of disparities, number of BP iterations on first level,
//! number of levels, truncation of discontinuity cost, truncation of data cost and weighting of data cost.
StereoBeliefPropagation_GPU
(
int
ndisp
,
int
iters
,
int
levels
,
float
disc_cost
,
float
data_cost
,
float
lambda
);
explicit
StereoBeliefPropagation_GPU
(
int
ndisp_
=
DEFAULT_NDISP
,
int
iters_
=
DEFAULT_ITERS
,
int
levels_
=
DEFAULT_LEVELS
,
int
msg_type_
=
MSG_TYPE_AUTO
,
float
msg_scale
=
1.0
f
);
//! the full constructor taking the number of disparities, number of BP iterations on each level,
//! number of levels, truncation of data cost, data weight,
//! truncation of discontinuity cost and discontinuity single jump
StereoBeliefPropagation_GPU
(
int
ndisp_
,
int
iters_
,
int
levels_
,
float
max_data_term_
,
float
data_weight_
,
float
max_disc_term_
,
float
disc_single_jump_
,
int
msg_type_
=
MSG_TYPE_AUTO
,
float
msg_scale
=
1.0
f
);
//! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,
//! if disparity is empty output type will be CV_
32
S else output type will be disparity.type().
//! if disparity is empty output type will be CV_
16
S else output type will be disparity.type().
void
operator
()(
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disparity
);
//! Acync version
...
...
@@ -404,9 +416,13 @@ namespace cv
int
iters
;
int
levels
;
float
disc_cost
;
float
data_cost
;
float
lambda
;
float
max_data_term
;
float
data_weight
;
float
max_disc_term
;
float
disc_single_jump
;
int
msg_type
;
float
msg_scale
;
private
:
GpuMat
u
,
d
,
l
,
r
,
u2
,
d2
,
l2
,
r2
;
std
::
vector
<
GpuMat
>
datas
;
...
...
modules/gpu/src/beliefpropagation_gpu.cpp
View file @
788ac96f
This diff is collapsed.
Click to expand it.
modules/gpu/src/cuda/beliefpropagation.cu
View file @
788ac96f
This diff is collapsed.
Click to expand it.
modules/gpu/src/cuda/saturate_cast.hpp
View file @
788ac96f
...
...
@@ -48,6 +48,9 @@
namespace
cv
{
namespace
gpu
{
// To fix link error: this func already defined in other obj file
namespace
{
template
<
typename
_Tp
>
__device__
_Tp
saturate_cast
(
uchar
v
)
{
return
_Tp
(
v
);
}
template
<
typename
_Tp
>
__device__
_Tp
saturate_cast
(
schar
v
)
{
return
_Tp
(
v
);
}
...
...
@@ -164,6 +167,7 @@ namespace cv
#endif
}
}
}
}
#endif
/* __OPENCV_GPU_SATURATE_CAST_HPP__ */
\ No newline at end of file
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