Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
0a32fc3b
Commit
0a32fc3b
authored
Mar 22, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stereo: smallRegionRemoval() is not inplace
parent
21d220d6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
matching.hpp
modules/stereo/src/matching.hpp
+10
-3
stereo_binary_bm.cpp
modules/stereo/src/stereo_binary_bm.cpp
+1
-1
stereo_binary_sgbm.cpp
modules/stereo/src/stereo_binary_sgbm.cpp
+1
-1
No files found.
modules/stereo/src/matching.hpp
View file @
0a32fc3b
...
@@ -493,6 +493,7 @@ namespace cv
...
@@ -493,6 +493,7 @@ namespace cv
template
<
typename
T
>
template
<
typename
T
>
void
smallRegionRemoval
(
const
Mat
&
currentMap
,
int
t
,
Mat
&
out
)
void
smallRegionRemoval
(
const
Mat
&
currentMap
,
int
t
,
Mat
&
out
)
{
{
CV_Assert
(
currentMap
.
data
!=
out
.
data
&&
"inplace is not supported"
);
CV_Assert
(
currentMap
.
cols
==
out
.
cols
);
CV_Assert
(
currentMap
.
cols
==
out
.
cols
);
CV_Assert
(
currentMap
.
rows
==
out
.
rows
);
CV_Assert
(
currentMap
.
rows
==
out
.
rows
);
CV_Assert
(
t
>=
0
);
CV_Assert
(
t
>=
0
);
...
@@ -511,16 +512,22 @@ namespace cv
...
@@ -511,16 +512,22 @@ namespace cv
int
speckle_size
=
0
;
int
speckle_size
=
0
;
st
=
0
;
st
=
0
;
dr
=
0
;
dr
=
0
;
for
(
int
i
=
1
;
i
<
height
-
1
;
i
++
)
for
(
int
i
=
0
;
i
<
height
;
i
++
)
{
{
int
iw
=
i
*
width
;
int
iw
=
i
*
width
;
for
(
int
j
=
1
;
j
<
width
-
1
;
j
++
)
for
(
int
j
=
0
;
j
<
width
;
j
++
)
{
if
(
i
<
1
||
i
>=
height
-
1
||
j
<
1
||
j
>=
width
-
1
)
{
{
outputMap
[
iw
+
j
]
=
0
;
continue
;
}
if
(
map
[
iw
+
j
]
!=
0
)
if
(
map
[
iw
+
j
]
!=
0
)
{
{
outputMap
[
iw
+
j
]
=
map
[
iw
+
j
];
outputMap
[
iw
+
j
]
=
map
[
iw
+
j
];
}
}
else
if
(
map
[
iw
+
j
]
==
0
)
else
//
if (map[iw + j] == 0)
{
{
T
nr
=
1
;
T
nr
=
1
;
T
avg
=
0
;
T
avg
=
0
;
...
...
modules/stereo/src/stereo_binary_bm.cpp
View file @
0a32fc3b
...
@@ -402,7 +402,7 @@ namespace cv
...
@@ -402,7 +402,7 @@ namespace cv
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_AVG_ALGORITHM
)
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_AVG_ALGORITHM
)
{
{
smallRegionRemoval
<
uint8_t
>
(
disp0
,
params
.
speckleWindowSize
,
disp0
);
smallRegionRemoval
<
uint8_t
>
(
disp0
.
clone
()
,
params
.
speckleWindowSize
,
disp0
);
}
}
else
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_ALGORITHM
)
else
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_ALGORITHM
)
{
{
...
...
modules/stereo/src/stereo_binary_sgbm.cpp
View file @
0a32fc3b
...
@@ -697,7 +697,7 @@ namespace cv
...
@@ -697,7 +697,7 @@ namespace cv
aux
.
create
(
height
,
width
,
CV_16S
);
aux
.
create
(
height
,
width
,
CV_16S
);
Median1x9Filter
<
short
>
(
disp
,
aux
);
Median1x9Filter
<
short
>
(
disp
,
aux
);
Median9x1Filter
<
short
>
(
aux
,
disp
);
Median9x1Filter
<
short
>
(
aux
,
disp
);
smallRegionRemoval
<
short
>
(
disp
,
params
.
speckleWindowSize
,
disp
);
smallRegionRemoval
<
short
>
(
disp
.
clone
()
,
params
.
speckleWindowSize
,
disp
);
}
}
else
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_ALGORITHM
)
else
if
(
params
.
regionRemoval
==
CV_SPECKLE_REMOVAL_ALGORITHM
)
{
{
...
...
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