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
05c7c932
Commit
05c7c932
authored
Sep 14, 2013
by
siddharth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloning_gui.cpp updated
parent
75b76554
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
41 deletions
+44
-41
cloning_gui.cpp
samples/cpp/cloning_gui.cpp
+44
-41
No files found.
samples/cpp/cloning_gui.cpp
View file @
05c7c932
...
...
@@ -190,7 +190,6 @@ void source(int event, int x, int y, int, void*)
void
destination
(
int
event
,
int
x
,
int
y
,
int
,
void
*
)
{
Mat
im1
;
minxd
=
INT_MAX
;
minyd
=
INT_MAX
;
maxxd
=
INT_MIN
;
maxyd
=
INT_MIN
;
im1
=
img2
.
clone
();
...
...
@@ -250,7 +249,6 @@ void destination(int event, int x, int y, int, void*)
}
}
const
Point
*
pts6
[
1
]
=
{
&
pts2
[
0
]};
fillPoly
(
res
,
pts6
,
&
numpts
,
1
,
Scalar
(
255
,
255
,
255
),
8
,
0
);
...
...
@@ -274,40 +272,6 @@ void destination(int event, int x, int y, int, void*)
im1
.
release
();
}
void
checkfile
(
char
*
file
)
{
while
(
1
)
{
printf
(
"Enter %s Image: "
,
file
);
if
(
!
strcmp
(
file
,
"Source"
))
{
cin
>>
src
;
if
(
access
(
src
,
F_OK
)
!=
-
1
)
{
break
;
}
else
{
printf
(
"Image doesn't exist
\n
"
);
}
}
else
if
(
!
strcmp
(
file
,
"Destination"
))
{
cin
>>
dest
;
if
(
access
(
dest
,
F_OK
)
!=
-
1
)
{
break
;
}
else
{
printf
(
"Image doesn't exist
\n
"
);
}
}
}
}
int
main
()
{
cout
<<
endl
;
...
...
@@ -348,13 +312,28 @@ int main()
if
(
num
==
1
||
num
==
2
||
num
==
3
)
{
checkfile
(
s
);
checkfile
(
d
);
string
src
,
dest
;
cout
<<
"Enter Source Image: "
;
cin
>>
src
;
cout
<<
"Enter Destination Image: "
;
cin
>>
dest
;
img0
=
imread
(
src
);
img2
=
imread
(
dest
);
if
(
!
img0
.
data
)
{
cout
<<
"Source Image does not exist"
<<
endl
;
exit
(
0
);
}
if
(
!
img2
.
data
)
{
cout
<<
"Destination Image does not exist"
<<
endl
;
exit
(
0
);
}
channel
=
img0
.
channels
();
res
=
Mat
::
zeros
(
img2
.
size
(),
CV_8UC1
);
...
...
@@ -376,7 +355,9 @@ int main()
}
else
if
(
num
==
4
)
{
checkfile
(
s
);
string
src
;
cout
<<
"Enter Source Image: "
;
cin
>>
src
;
cout
<<
"Enter RGB values: "
<<
endl
;
cout
<<
"Red: "
;
...
...
@@ -390,6 +371,12 @@ int main()
img0
=
imread
(
src
);
if
(
!
img0
.
data
)
{
cout
<<
"Source Image does not exist"
<<
endl
;
exit
(
0
);
}
res1
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC1
);
final
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC3
);
...
...
@@ -402,7 +389,9 @@ int main()
}
else
if
(
num
==
5
)
{
checkfile
(
s
);
string
src
;
cout
<<
"Enter Source Image: "
;
cin
>>
src
;
cout
<<
"alpha: "
;
cin
>>
alpha
;
...
...
@@ -412,6 +401,12 @@ int main()
img0
=
imread
(
src
);
if
(
!
img0
.
data
)
{
cout
<<
"Source Image does not exist"
<<
endl
;
exit
(
0
);
}
res1
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC1
);
final
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC3
);
...
...
@@ -424,7 +419,9 @@ int main()
}
else
if
(
num
==
6
)
{
checkfile
(
s
);
string
src
;
cout
<<
"Enter Source Image: "
;
cin
>>
src
;
cout
<<
"low_threshold: "
;
cin
>>
low_t
;
...
...
@@ -437,6 +434,12 @@ int main()
img0
=
imread
(
src
);
if
(
!
img0
.
data
)
{
cout
<<
"Source Image does not exist"
<<
endl
;
exit
(
0
);
}
res1
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC1
);
final
=
Mat
::
zeros
(
img0
.
size
(),
CV_8UC3
);
...
...
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