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
14b43831
Commit
14b43831
authored
Sep 14, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12512 from sturkmen72:patch-1
parents
cecb8789
6d5f7b72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
seamless_cloning.cpp
modules/photo/src/seamless_cloning.cpp
+14
-8
No files found.
modules/photo/src/seamless_cloning.cpp
View file @
14b43831
...
...
@@ -54,20 +54,27 @@ void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point
const
Mat
src
=
_src
.
getMat
();
const
Mat
dest
=
_dst
.
getMat
();
const
Mat
mask
=
_mask
.
getMat
();
_blend
.
create
(
dest
.
size
(),
CV_8UC3
);
dest
.
copyTo
(
_blend
);
Mat
blend
=
_blend
.
getMat
();
dest
.
copyTo
(
blend
);
int
minx
=
INT_MAX
,
miny
=
INT_MAX
,
maxx
=
INT_MIN
,
maxy
=
INT_MIN
;
int
h
=
mask
.
size
().
height
;
int
w
=
mask
.
size
().
width
;
Mat
gray
;
if
(
mask
.
channels
()
==
3
)
cvtColor
(
mask
,
gray
,
COLOR_BGR2GRAY
);
else
mask
.
copyTo
(
gray
);
{
if
(
mask
.
empty
())
gray
=
Mat
(
src
.
rows
,
src
.
cols
,
CV_8UC1
,
Scalar
(
255
));
else
mask
.
copyTo
(
gray
);
}
Mat
gray_inner
=
gray
(
Rect
(
1
,
1
,
gray
.
cols
-
2
,
gray
.
rows
-
2
));
copyMakeBorder
(
gray_inner
,
gray
,
1
,
1
,
1
,
1
,
BORDER_ISOLATED
|
BORDER_CONSTANT
,
Scalar
(
0
));
int
minx
=
INT_MAX
,
miny
=
INT_MAX
,
maxx
=
INT_MIN
,
maxy
=
INT_MIN
;
int
h
=
gray
.
size
().
height
;
int
w
=
gray
.
size
().
width
;
for
(
int
i
=
0
;
i
<
h
;
i
++
)
{
...
...
@@ -102,7 +109,6 @@ void cv::seamlessClone(InputArray _src, InputArray _dst, InputArray _mask, Point
Cloning
obj
;
obj
.
normalClone
(
destinationROI
,
sourceROI
,
maskROI
,
recoveredROI
,
flags
);
}
void
cv
::
colorChange
(
InputArray
_src
,
InputArray
_mask
,
OutputArray
_dst
,
float
red
,
float
green
,
float
blue
)
...
...
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