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
28030952
Commit
28030952
authored
Aug 17, 2010
by
Andrey Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added get_first_k_initial_global_init_global_cost in gpu::SCBP
parent
9a669b1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+4
-2
constantspacebp_gpu.cpp
modules/gpu/src/constantspacebp_gpu.cpp
+10
-10
constantspacebp.cu
modules/gpu/src/cuda/constantspacebp.cu
+0
-0
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
28030952
...
...
@@ -235,7 +235,7 @@ namespace cv
class
CV_EXPORTS
CudaMem
{
public
:
public
:
enum
{
ALLOC_PAGE_LOCKED
=
1
,
ALLOC_ZEROCOPY
=
2
,
ALLOC_WRITE_COMBINED
=
4
};
CudaMem
();
...
...
@@ -417,7 +417,7 @@ namespace cv
//! Acync version
void
operator
()(
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disparity
,
Stream
&
stream
);
//! version for user specified data term
void
operator
()(
const
GpuMat
&
data
,
GpuMat
&
disparity
);
void
operator
()(
const
GpuMat
&
data
,
GpuMat
&
disparity
,
Stream
&
stream
);
...
...
@@ -486,6 +486,8 @@ namespace cv
int
min_disp_th
;
int
msg_type
;
bool
use_local_init_data_cost
;
private
:
GpuMat
u
[
2
],
d
[
2
],
l
[
2
],
r
[
2
];
GpuMat
disp_selected_pyr
[
2
];
...
...
modules/gpu/src/constantspacebp_gpu.cpp
View file @
28030952
...
...
@@ -62,10 +62,10 @@ namespace cv { namespace gpu { namespace csbp
const
DevMem2D
&
left
,
const
DevMem2D
&
right
,
const
DevMem2D
&
temp
);
void
init_data_cost
(
int
rows
,
int
cols
,
short
*
disp_selected_pyr
,
short
*
data_cost_selected
,
size_t
msg_step
,
int
h
,
int
w
,
int
level
,
int
nr_plane
,
int
ndisp
,
int
channels
,
cudaStream_t
stream
);
size_t
msg_step
,
int
h
,
int
w
,
int
level
,
int
nr_plane
,
int
ndisp
,
int
channels
,
bool
use_local_init_data_cost
,
cudaStream_t
stream
);
void
init_data_cost
(
int
rows
,
int
cols
,
float
*
disp_selected_pyr
,
float
*
data_cost_selected
,
size_t
msg_step
,
int
h
,
int
w
,
int
level
,
int
nr_plane
,
int
ndisp
,
int
channels
,
cudaStream_t
stream
);
size_t
msg_step
,
int
h
,
int
w
,
int
level
,
int
nr_plane
,
int
ndisp
,
int
channels
,
bool
use_local_init_data_cost
,
cudaStream_t
stream
);
void
compute_data_cost
(
const
short
*
disp_selected_pyr
,
short
*
data_cost
,
size_t
msg_step1
,
size_t
msg_step2
,
int
rows
,
int
cols
,
int
h
,
int
w
,
int
h2
,
int
level
,
int
nr_plane
,
int
channels
,
cudaStream_t
stream
);
...
...
@@ -111,7 +111,7 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp_, int iters_, in
:
ndisp
(
ndisp_
),
iters
(
iters_
),
levels
(
levels_
),
nr_plane
(
nr_plane_
),
max_data_term
(
DEFAULT_MAX_DATA_TERM
),
data_weight
(
DEFAULT_DATA_WEIGHT
),
max_disc_term
(
DEFAULT_MAX_DISC_TERM
),
disc_single_jump
(
DEFAULT_DISC_SINGLE_JUMP
),
min_disp_th
(
0
),
msg_type
(
msg_type_
)
msg_type
(
msg_type_
)
,
use_local_init_data_cost
(
true
)
{
CV_Assert
(
msg_type_
==
CV_32F
||
msg_type_
==
CV_16S
);
}
...
...
@@ -122,7 +122,7 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp_, int iters_, in
:
ndisp
(
ndisp_
),
iters
(
iters_
),
levels
(
levels_
),
nr_plane
(
nr_plane_
),
max_data_term
(
max_data_term_
),
data_weight
(
data_weight_
),
max_disc_term
(
max_disc_term_
),
disc_single_jump
(
disc_single_jump_
),
min_disp_th
(
min_disp_th_
),
msg_type
(
msg_type_
)
msg_type
(
msg_type_
)
,
use_local_init_data_cost
(
true
)
{
CV_Assert
(
msg_type_
==
CV_32F
||
msg_type_
==
CV_16S
);
}
...
...
@@ -131,7 +131,7 @@ template<class T>
static
void
csbp_operator
(
StereoConstantSpaceBP
&
rthis
,
GpuMat
u
[
2
],
GpuMat
d
[
2
],
GpuMat
l
[
2
],
GpuMat
r
[
2
],
GpuMat
disp_selected_pyr
[
2
],
GpuMat
&
data_cost
,
GpuMat
&
data_cost_selected
,
GpuMat
&
temp
,
GpuMat
&
out
,
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disp
,
cudaStream_t
stream
)
bool
use_local_init_data_cost
,
cudaStream_t
stream
)
{
CV_DbgAssert
(
0
<
rthis
.
ndisp
&&
0
<
rthis
.
iters
&&
0
<
rthis
.
levels
&&
0
<
rthis
.
nr_plane
&&
left
.
rows
==
right
.
rows
&&
left
.
cols
==
right
.
cols
&&
left
.
type
()
==
right
.
type
());
...
...
@@ -202,7 +202,7 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat u[2], GpuMat d[2]
////////////////////////////////////////////////////////////////////////////
// Compute
csbp
::
load_constants
(
rthis
.
ndisp
,
rthis
.
max_data_term
,
rthis
.
data_weight
,
csbp
::
load_constants
(
rthis
.
ndisp
,
rthis
.
max_data_term
,
rthis
.
data_weight
,
rthis
.
max_disc_term
,
rthis
.
disc_single_jump
,
rthis
.
min_disp_th
,
left
,
right
,
temp
);
l
[
0
]
=
zero
;
...
...
@@ -225,7 +225,7 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat u[2], GpuMat d[2]
if
(
i
==
levels
-
1
)
{
csbp
::
init_data_cost
(
left
.
rows
,
left
.
cols
,
disp_selected_pyr
[
cur_idx
].
ptr
<
T
>
(),
data_cost_selected
.
ptr
<
T
>
(),
step_pyr
[
i
],
rows_pyr
[
i
],
cols_pyr
[
i
],
i
,
nr_plane_pyr
[
i
],
rthis
.
ndisp
,
left
.
channels
(),
stream
);
step_pyr
[
i
],
rows_pyr
[
i
],
cols_pyr
[
i
],
i
,
nr_plane_pyr
[
i
],
rthis
.
ndisp
,
left
.
channels
(),
use_local_init_data_cost
,
stream
);
}
else
{
...
...
@@ -265,20 +265,20 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat u[2], GpuMat d[2]
typedef
void
(
*
csbp_operator_t
)(
StereoConstantSpaceBP
&
rthis
,
GpuMat
u
[
2
],
GpuMat
d
[
2
],
GpuMat
l
[
2
],
GpuMat
r
[
2
],
GpuMat
disp_selected_pyr
[
2
],
GpuMat
&
data_cost
,
GpuMat
&
data_cost_selected
,
GpuMat
&
temp
,
GpuMat
&
out
,
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disp
,
cudaStream_t
stream
);
bool
use_local_init_data_cost
,
cudaStream_t
stream
);
const
static
csbp_operator_t
operators
[]
=
{
0
,
0
,
0
,
csbp_operator
<
short
>
,
0
,
csbp_operator
<
float
>
,
0
,
0
};
void
cv
::
gpu
::
StereoConstantSpaceBP
::
operator
()(
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disp
)
{
CV_Assert
(
msg_type
==
CV_32F
||
msg_type
==
CV_16S
);
operators
[
msg_type
](
*
this
,
u
,
d
,
l
,
r
,
disp_selected_pyr
,
data_cost
,
data_cost_selected
,
temp
,
out
,
left
,
right
,
disp
,
0
);
operators
[
msg_type
](
*
this
,
u
,
d
,
l
,
r
,
disp_selected_pyr
,
data_cost
,
data_cost_selected
,
temp
,
out
,
left
,
right
,
disp
,
use_local_init_data_cost
,
0
);
}
void
cv
::
gpu
::
StereoConstantSpaceBP
::
operator
()(
const
GpuMat
&
left
,
const
GpuMat
&
right
,
GpuMat
&
disp
,
Stream
&
stream
)
{
CV_Assert
(
msg_type
==
CV_32F
||
msg_type
==
CV_16S
);
operators
[
msg_type
](
*
this
,
u
,
d
,
l
,
r
,
disp_selected_pyr
,
data_cost
,
data_cost_selected
,
temp
,
out
,
left
,
right
,
disp
,
StreamAccessor
::
getStream
(
stream
));
operators
[
msg_type
](
*
this
,
u
,
d
,
l
,
r
,
disp_selected_pyr
,
data_cost
,
data_cost_selected
,
temp
,
out
,
left
,
right
,
disp
,
use_local_init_data_cost
,
StreamAccessor
::
getStream
(
stream
));
}
#endif
/* !defined (HAVE_CUDA) */
modules/gpu/src/cuda/constantspacebp.cu
View file @
28030952
This diff is collapsed.
Click to expand it.
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