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
fb804cb3
Commit
fb804cb3
authored
Mar 17, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed StereoBM crash on MacOSX 10.7
parent
d6062327
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
stereobm.cpp
modules/calib3d/src/stereobm.cpp
+10
-8
No files found.
modules/calib3d/src/stereobm.cpp
View file @
fb804cb3
...
...
@@ -540,7 +540,7 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
sad
=
(
int
*
)
alignPtr
(
buf
+
sizeof
(
sad
[
0
]),
ALIGN
);
hsad0
=
(
int
*
)
alignPtr
(
sad
+
ndisp
+
1
+
dy0
*
ndisp
,
ALIGN
);
htext
=
(
int
*
)
alignPtr
((
int
*
)(
hsad0
+
(
height
+
dy1
)
*
ndisp
)
+
wsz2
+
2
,
ALIGN
);
cbuf0
=
(
uchar
*
)
alignPtr
(
htext
+
height
+
wsz2
+
2
+
dy0
*
ndisp
,
ALIGN
);
cbuf0
=
(
uchar
*
)
alignPtr
(
(
uchar
*
)(
htext
+
height
+
wsz2
+
2
)
+
dy0
*
ndisp
,
ALIGN
);
for
(
x
=
0
;
x
<
TABSZ
;
x
++
)
tab
[
x
]
=
(
uchar
)
std
::
abs
(
x
-
ftzero
);
...
...
@@ -552,8 +552,8 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
for
(
x
=
-
wsz2
-
1
;
x
<
wsz2
;
x
++
)
{
hsad
=
hsad0
-
dy0
*
ndisp
;
cbuf
=
cbuf0
+
(
x
+
wsz2
+
1
)
*
cstep
-
dy0
*
ndisp
;
lptr
=
lptr0
+
MIN
(
MAX
(
x
,
-
lofs
),
width
-
lofs
-
1
)
-
dy0
*
sstep
;
rptr
=
rptr0
+
MIN
(
MAX
(
x
,
-
rofs
),
width
-
rofs
-
1
)
-
dy0
*
sstep
;
lptr
=
lptr0
+
std
::
min
(
std
::
max
(
x
,
-
lofs
),
width
-
lofs
-
1
)
-
dy0
*
sstep
;
rptr
=
rptr0
+
std
::
min
(
std
::
max
(
x
,
-
rofs
),
width
-
rofs
-
1
)
-
dy0
*
sstep
;
for
(
y
=
-
dy0
;
y
<
height
+
dy1
;
y
++
,
hsad
+=
ndisp
,
cbuf
+=
ndisp
,
lptr
+=
sstep
,
rptr
+=
sstep
)
{
...
...
@@ -567,7 +567,7 @@ findStereoCorrespondenceBM( const Mat& left, const Mat& right,
htext
[
y
]
+=
tab
[
lval
];
}
}
// initialize the left and right borders of the disparity map
for
(
y
=
0
;
y
<
height
;
y
++
)
{
...
...
@@ -852,10 +852,12 @@ static void findStereoCorrespondenceBM( const Mat& left0, const Mat& right0, Mat
}
int
wsz
=
state
->
SADWindowSize
;
int
bufSize0
=
(
ndisp
+
2
)
*
sizeof
(
int
)
+
(
height
+
wsz
+
2
)
*
ndisp
*
sizeof
(
int
)
+
(
height
+
wsz
+
2
)
*
sizeof
(
int
)
+
(
height
+
wsz
+
2
)
*
ndisp
*
(
wsz
+
1
)
*
sizeof
(
uchar
)
+
256
;
int
bufSize1
=
(
width
+
state
->
preFilterSize
+
2
)
*
sizeof
(
int
)
+
256
;
int
bufSize0
=
(
int
)((
ndisp
+
2
)
*
sizeof
(
int
));
bufSize0
+=
(
int
)((
height
+
wsz
+
2
)
*
ndisp
*
sizeof
(
int
));
bufSize0
+=
(
int
)((
height
+
wsz
+
2
)
*
sizeof
(
int
));
bufSize0
+=
(
int
)((
height
+
wsz
+
2
)
*
ndisp
*
(
wsz
+
2
)
*
sizeof
(
uchar
)
+
256
);
int
bufSize1
=
(
int
)((
width
+
state
->
preFilterSize
+
2
)
*
sizeof
(
int
)
+
256
);
int
bufSize2
=
0
;
if
(
state
->
speckleRange
>=
0
&&
state
->
speckleWindowSize
>
0
)
bufSize2
=
width
*
height
*
(
sizeof
(
cv
::
Point_
<
short
>
)
+
sizeof
(
int
)
+
sizeof
(
uchar
));
...
...
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