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
9f191264
Commit
9f191264
authored
Sep 26, 2013
by
Alexander Smorkalov
Committed by
OpenCV Buildbot
Sep 26, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1502 from melody-rain:2.4_Stereo_Match_Const_Space_BP
parents
0b41df46
c7c0a41e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
stereo_csbp.cpp
modules/ocl/src/stereo_csbp.cpp
+33
-7
No files found.
modules/ocl/src/stereo_csbp.cpp
View file @
9f191264
...
...
@@ -96,6 +96,10 @@ namespace cv
{
namespace
stereoCSBP
{
static
inline
int
divUp
(
int
total
,
int
grain
)
{
return
(
total
+
grain
-
1
)
/
grain
;
}
static
string
get_kernel_name
(
string
kernel_name
,
int
data_type
)
{
stringstream
idxStr
;
...
...
@@ -125,7 +129,10 @@ namespace cv
//size_t blockSize = 256;
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
w
,
h
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
w
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
h
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
cdisp_step1
=
msg_step
*
h
;
openCLVerifyKernel
(
clCxt
,
kernel
,
localThreads
);
...
...
@@ -212,7 +219,10 @@ namespace cv
//size_t blockSize = 256;
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
w
,
h
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
w
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
h
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
disp_step
=
msg_step
*
h
;
openCLVerifyKernel
(
clCxt
,
kernel
,
localThreads
);
...
...
@@ -244,7 +254,10 @@ namespace cv
//size_t blockSize = 256;
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
w
,
h
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
w
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
h
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
disp_step
=
msg_step
*
h
;
openCLVerifyKernel
(
clCxt
,
kernel
,
localThreads
);
...
...
@@ -275,10 +288,14 @@ namespace cv
init_data_cost_reduce_caller
(
left
,
right
,
temp
,
rthis
,
msg_step
,
h
,
w
,
level
);
if
(
rthis
.
use_local_init_data_cost
==
true
)
{
get_first_initial_local_caller
(
data_cost_selected
,
disp_selected_pyr
,
temp
,
rthis
,
h
,
w
,
nr_plane
,
msg_step
);
}
else
{
get_first_initial_global_caller
(
data_cost_selected
,
disp_selected_pyr
,
temp
,
rthis
,
h
,
w
,
nr_plane
,
msg_step
);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -297,8 +314,11 @@ namespace cv
cl_kernel
kernel
=
openCLGetKernelFromSource
(
clCxt
,
&
stereocsbp
,
kernelName
);
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
w
,
h
,
1
};
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
w
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
h
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
disp_step1
=
msg_step1
*
h
;
int
disp_step2
=
msg_step2
*
h2
;
...
...
@@ -407,7 +427,10 @@ namespace cv
//size_t blockSize = 256;
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
w
,
h
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
w
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
h
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
disp_step1
=
msg_step1
*
h
;
int
disp_step2
=
msg_step2
*
h2
;
...
...
@@ -508,7 +531,10 @@ namespace cv
//size_t blockSize = 256;
size_t
localThreads
[]
=
{
32
,
8
,
1
};
size_t
globalThreads
[]
=
{
disp
.
cols
,
disp
.
rows
,
1
};
size_t
globalThreads
[]
=
{
divUp
(
disp
.
cols
,
localThreads
[
0
])
*
localThreads
[
0
],
divUp
(
disp
.
rows
,
localThreads
[
1
])
*
localThreads
[
1
],
1
};
int
step_size
=
disp
.
step
/
disp
.
elemSize
();
int
disp_step
=
disp
.
rows
*
msg_step
;
...
...
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