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
070d87fb
Commit
070d87fb
authored
Dec 13, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug with prefilter_xsobel preset.
parent
e193fa11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
2 deletions
+53
-2
stereobm.cu
modules/gpu/src/cuda/stereobm.cu
+0
-1
stereobm.cpp
modules/gpu/src/stereobm.cpp
+1
-1
stereo_bm.cpp
tests/gpu/src/stereo_bm.cpp
+52
-0
No files found.
modules/gpu/src/cuda/stereobm.cu
View file @
070d87fb
...
...
@@ -390,7 +390,6 @@ extern "C" __global__ void prefilter_kernel(DevMem2D output, int prefilterCap)
}
}
extern "C" void prefilter_xsobel(const DevMem2D& input, const DevMem2D& output, int prefilterCap, cudaStream_t & stream)
{
cudaChannelFormatDesc desc = cudaCreateChannelDesc<unsigned char>();
...
...
modules/gpu/src/stereobm.cpp
View file @
070d87fb
...
...
@@ -62,7 +62,7 @@ namespace cv { namespace gpu
{
//extern "C" void stereoBM_GPU(const DevMem2D& left, const DevMem2D& right, const DevMem2D& disp, int ndisp, int winsz, const DevMem2D_<uint>& minSSD_buf);
extern
"C"
void
stereoBM_GPU
(
const
DevMem2D
&
left
,
const
DevMem2D
&
right
,
const
DevMem2D
&
disp
,
int
ndisp
,
int
winsz
,
const
DevMem2D_
<
uint
>&
minSSD_buf
,
cudaStream_t
&
stream
);
extern
"C"
void
prefilter_xsobel
(
const
DevMem2D
&
input
,
const
DevMem2D
output
,
int
prefilterCap
/*= 31*/
,
cudaStream_t
&
stream
);
extern
"C"
void
prefilter_xsobel
(
const
DevMem2D
&
input
,
const
DevMem2D
&
output
,
int
prefilterCap
/*= 31*/
,
cudaStream_t
&
stream
);
extern
"C"
void
postfilter_textureness
(
const
DevMem2D
&
input
,
int
winsz
,
float
avgTexturenessThreshold
,
const
DevMem2D
&
disp
,
cudaStream_t
&
stream
);
}
}}
...
...
tests/gpu/src/stereo_bm.cpp
View file @
070d87fb
...
...
@@ -45,13 +45,65 @@
#include "opencv2/highgui/highgui.hpp"
using
namespace
cv
;
using
namespace
cv
::
gpu
;
struct
CV_GpuStereoBMTest
:
public
CvTest
{
CV_GpuStereoBMTest
()
:
CvTest
(
"GPU-StereoBM"
,
"StereoBM"
){}
~
CV_GpuStereoBMTest
()
{}
void
run_stress
()
{
//cv::setBreakOnError(true);
int
winsz
[]
=
{
13
,
15
,
17
,
19
};
int
disps
[]
=
{
128
,
160
,
192
,
256
};
Size
res
[]
=
{
Size
(
1027
,
768
),
Size
(
1280
,
1024
),
Size
(
1600
,
1152
),
Size
(
1920
,
1080
)
};
RNG
rng
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
int
winSize
=
cvRound
(
rng
.
uniform
(
2
,
11
))
*
2
+
1
;
for
(
int
j
=
0
;
j
<
10
;
++
j
)
{
int
ndisp
=
cvRound
(
rng
.
uniform
(
5
,
32
))
*
8
;
for
(
int
s
=
0
;
s
<
10
;
++
s
)
{
int
w
=
cvRound
(
rng
.
uniform
(
1024
,
2048
));
int
h
=
cvRound
(
rng
.
uniform
(
768
,
1152
));
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
//int winSize = winsz[i];
//int disp = disps[j];
Size
imgSize
(
w
,
h
);
//res[s];
int
preset
=
p
;
printf
(
"Preset = %d, nidsp = %d, winsz = %d, width = %d, height = %d
\n
"
,
p
,
ndisp
,
winSize
,
imgSize
.
width
,
imgSize
.
height
);
GpuMat
l
(
imgSize
,
CV_8U
);
GpuMat
r
(
imgSize
,
CV_8U
);
GpuMat
disparity
;
StereoBM_GPU
bm
(
preset
,
ndisp
,
winSize
);
bm
(
l
,
r
,
disparity
);
}
}
}
}
}
void
run
(
int
)
{
/*run_stress();
return;*/
cv
::
Mat
img_l
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-L.png"
,
0
);
cv
::
Mat
img_r
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-R.png"
,
0
);
cv
::
Mat
img_reference
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-disp.png"
,
0
);
...
...
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