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
08019732
Commit
08019732
authored
Jun 06, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14729 from arnaudbrejeon:bug_fix_14722
parents
aab9ef42
e8e020ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
inpaint.cpp
modules/photo/src/inpaint.cpp
+4
-4
test_inpaint.cpp
modules/photo/test/test_inpaint.cpp
+18
-0
No files found.
modules/photo/src/inpaint.cpp
View file @
08019732
...
...
@@ -299,7 +299,7 @@ icvTeleaInpaintFMM(const CvMat *f, CvMat *t, CvMat *out, int range, CvPriorityQu
else
if
(
q
==
1
)
{
i
=
ii
;
j
=
jj
-
1
;}
else
if
(
q
==
2
)
{
i
=
ii
+
1
;
j
=
jj
;}
else
if
(
q
==
3
)
{
i
=
ii
;
j
=
jj
+
1
;}
if
((
i
<=
1
)
||
(
j
<=
1
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
((
i
<=
0
)
||
(
j
<=
0
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
(
CV_MAT_ELEM
(
*
f
,
uchar
,
i
,
j
)
==
INSIDE
)
{
dist
=
min4
(
FastMarching_solve
(
i
-
1
,
j
,
i
,
j
-
1
,
f
,
t
),
...
...
@@ -411,7 +411,7 @@ icvTeleaInpaintFMM(const CvMat *f, CvMat *t, CvMat *out, int range, CvPriorityQu
else
if
(
q
==
1
)
{
i
=
ii
;
j
=
jj
-
1
;}
else
if
(
q
==
2
)
{
i
=
ii
+
1
;
j
=
jj
;}
else
if
(
q
==
3
)
{
i
=
ii
;
j
=
jj
+
1
;}
if
((
i
<=
1
)
||
(
j
<=
1
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
((
i
<=
0
)
||
(
j
<=
0
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
(
CV_MAT_ELEM
(
*
f
,
uchar
,
i
,
j
)
==
INSIDE
)
{
dist
=
min4
(
FastMarching_solve
(
i
-
1
,
j
,
i
,
j
-
1
,
f
,
t
),
...
...
@@ -531,7 +531,7 @@ icvNSInpaintFMM(const CvMat *f, CvMat *t, CvMat *out, int range, CvPriorityQueue
else
if
(
q
==
1
)
{
i
=
ii
;
j
=
jj
-
1
;}
else
if
(
q
==
2
)
{
i
=
ii
+
1
;
j
=
jj
;}
else
if
(
q
==
3
)
{
i
=
ii
;
j
=
jj
+
1
;}
if
((
i
<=
1
)
||
(
j
<=
1
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
((
i
<=
0
)
||
(
j
<=
0
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
(
CV_MAT_ELEM
(
*
f
,
uchar
,
i
,
j
)
==
INSIDE
)
{
dist
=
min4
(
FastMarching_solve
(
i
-
1
,
j
,
i
,
j
-
1
,
f
,
t
),
...
...
@@ -619,7 +619,7 @@ icvNSInpaintFMM(const CvMat *f, CvMat *t, CvMat *out, int range, CvPriorityQueue
else
if
(
q
==
1
)
{
i
=
ii
;
j
=
jj
-
1
;}
else
if
(
q
==
2
)
{
i
=
ii
+
1
;
j
=
jj
;}
else
if
(
q
==
3
)
{
i
=
ii
;
j
=
jj
+
1
;}
if
((
i
<=
1
)
||
(
j
<=
1
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
((
i
<=
0
)
||
(
j
<=
0
)
||
(
i
>
t
->
rows
-
1
)
||
(
j
>
t
->
cols
-
1
))
continue
;
if
(
CV_MAT_ELEM
(
*
f
,
uchar
,
i
,
j
)
==
INSIDE
)
{
dist
=
min4
(
FastMarching_solve
(
i
-
1
,
j
,
i
,
j
-
1
,
f
,
t
),
...
...
modules/photo/test/test_inpaint.cpp
View file @
08019732
...
...
@@ -139,4 +139,22 @@ TEST_P(formats, 1c)
INSTANTIATE_TEST_CASE_P
(
Photo_Inpaint
,
formats
,
testing
::
Values
(
CV_32F
,
CV_16U
,
CV_8U
));
TEST
(
Photo_InpaintBorders
,
regression
)
{
Mat
img
(
64
,
64
,
CV_8U
);
img
=
128
;
img
(
Rect
(
0
,
0
,
16
,
64
))
=
0
;
Mat
mask
(
64
,
64
,
CV_8U
);
mask
=
0
;
mask
(
Rect
(
0
,
0
,
16
,
64
))
=
255
;
Mat
inpainted
;
inpaint
(
img
,
mask
,
inpainted
,
1
,
INPAINT_TELEA
);
Mat
diff
;
cv
::
absdiff
(
inpainted
,
128
*
Mat
::
ones
(
inpainted
.
size
(),
inpainted
.
type
()),
diff
);
ASSERT_TRUE
(
countNonZero
(
diff
)
==
0
);
}
}}
// namespace
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