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
440ba2e4
Commit
440ba2e4
authored
Jul 21, 2016
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Passing Disparity Shift as a parameter.
parent
0e9c8e2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
stereobm.cpp
modules/calib3d/src/stereobm.cpp
+7
-11
No files found.
modules/calib3d/src/stereobm.cpp
View file @
440ba2e4
...
@@ -317,7 +317,6 @@ prefilterXSobel( const Mat& src, Mat& dst, int ftzero )
...
@@ -317,7 +317,6 @@ prefilterXSobel( const Mat& src, Mat& dst, int ftzero )
}
}
static
int
DISPARITY_SHIFT
;
static
const
int
DISPARITY_SHIFT_16S
=
4
;
static
const
int
DISPARITY_SHIFT_16S
=
4
;
static
const
int
DISPARITY_SHIFT_32S
=
8
;
static
const
int
DISPARITY_SHIFT_32S
=
8
;
...
@@ -574,7 +573,7 @@ template <typename mType>
...
@@ -574,7 +573,7 @@ template <typename mType>
static
void
static
void
findStereoCorrespondenceBM_
(
const
Mat
&
left
,
const
Mat
&
right
,
findStereoCorrespondenceBM_
(
const
Mat
&
left
,
const
Mat
&
right
,
Mat
&
disp
,
Mat
&
cost
,
const
StereoBMParams
&
state
,
Mat
&
disp
,
Mat
&
cost
,
const
StereoBMParams
&
state
,
uchar
*
buf
,
int
_dy0
,
int
_dy1
)
uchar
*
buf
,
int
_dy0
,
int
_dy1
,
const
int
disp_shift
)
{
{
const
int
ALIGN
=
16
;
const
int
ALIGN
=
16
;
...
@@ -590,7 +589,7 @@ findStereoCorrespondenceBM_( const Mat& left, const Mat& right,
...
@@ -590,7 +589,7 @@ findStereoCorrespondenceBM_( const Mat& left, const Mat& right,
int
ftzero
=
state
.
preFilterCap
;
int
ftzero
=
state
.
preFilterCap
;
int
textureThreshold
=
state
.
textureThreshold
;
int
textureThreshold
=
state
.
textureThreshold
;
int
uniquenessRatio
=
state
.
uniquenessRatio
;
int
uniquenessRatio
=
state
.
uniquenessRatio
;
mType
FILTERED
=
(
mType
)((
mindisp
-
1
)
<<
DISPARITY_SHIFT
);
mType
FILTERED
=
(
mType
)((
mindisp
-
1
)
<<
disp_shift
);
#if CV_NEON
#if CV_NEON
CV_Assert
(
ndisp
%
8
==
0
);
CV_Assert
(
ndisp
%
8
==
0
);
...
@@ -850,7 +849,7 @@ findStereoCorrespondenceBM_( const Mat& left, const Mat& right,
...
@@ -850,7 +849,7 @@ findStereoCorrespondenceBM_( const Mat& left, const Mat& right,
int
p
=
sad
[
mind
+
1
],
n
=
sad
[
mind
-
1
];
int
p
=
sad
[
mind
+
1
],
n
=
sad
[
mind
-
1
];
d
=
p
+
n
-
2
*
sad
[
mind
]
+
std
::
abs
(
p
-
n
);
d
=
p
+
n
-
2
*
sad
[
mind
]
+
std
::
abs
(
p
-
n
);
dptr
[
y
*
dstep
]
=
(
mType
)(((
ndisp
-
mind
-
1
+
mindisp
)
*
256
+
(
d
!=
0
?
(
p
-
n
)
*
256
/
d
:
0
)
+
15
)
dptr
[
y
*
dstep
]
=
(
mType
)(((
ndisp
-
mind
-
1
+
mindisp
)
*
256
+
(
d
!=
0
?
(
p
-
n
)
*
256
/
d
:
0
)
+
15
)
>>
(
DISPARITY_SHIFT_32S
-
DISPARITY_SHIFT
));
>>
(
DISPARITY_SHIFT_32S
-
disp_shift
));
costptr
[
y
*
coststep
]
=
sad
[
mind
];
costptr
[
y
*
coststep
]
=
sad
[
mind
];
}
}
}
}
...
@@ -862,15 +861,12 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
...
@@ -862,15 +861,12 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
Mat
&
disp
,
Mat
&
cost
,
const
StereoBMParams
&
state
,
Mat
&
disp
,
Mat
&
cost
,
const
StereoBMParams
&
state
,
uchar
*
buf
,
int
_dy0
,
int
_dy1
)
uchar
*
buf
,
int
_dy0
,
int
_dy1
)
{
{
if
(
disp
.
type
()
==
CV_16S
){
if
(
disp
.
type
()
==
CV_16S
)
DISPARITY_SHIFT
=
DISPARITY_SHIFT_16S
;
findStereoCorrespondenceBM_
<
short
>
(
left
,
right
,
disp
,
cost
,
state
,
findStereoCorrespondenceBM_
<
short
>
(
left
,
right
,
disp
,
cost
,
state
,
buf
,
_dy0
,
_dy1
);
buf
,
_dy0
,
_dy1
,
DISPARITY_SHIFT_16S
);
}
else
{
else
DISPARITY_SHIFT
=
DISPARITY_SHIFT_32S
;
findStereoCorrespondenceBM_
<
int
>
(
left
,
right
,
disp
,
cost
,
state
,
findStereoCorrespondenceBM_
<
int
>
(
left
,
right
,
disp
,
cost
,
state
,
buf
,
_dy0
,
_dy1
);
buf
,
_dy0
,
_dy1
,
DISPARITY_SHIFT_32S
);
}
}
}
#ifdef HAVE_OPENCL
#ifdef 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