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
ed9c9241
Commit
ed9c9241
authored
8 years ago
by
vskarlsruhe
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code easier to read now
Increase readability by using namespace std
parent
dcbed8d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
AddingImages.cpp
samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp
+9
-8
No files found.
samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp
View file @
ed9c9241
...
...
@@ -9,6 +9,7 @@
#include <iostream>
using
namespace
cv
;
using
namespace
std
;
/**
* @function main
...
...
@@ -21,10 +22,10 @@ int main( void )
Mat
src1
,
src2
,
dst
;
/// Ask the user enter alpha
std
::
cout
<<
" Simple Linear Blender "
<<
std
::
endl
;
std
::
cout
<<
"-----------------------"
<<
std
::
endl
;
std
::
cout
<<
"* Enter alpha [0-1]: "
;
std
::
cin
>>
input
;
cout
<<
" Simple Linear Blender "
<<
endl
;
cout
<<
"-----------------------"
<<
endl
;
cout
<<
"* Enter alpha [0-1]: "
;
cin
>>
input
;
// We use the alpha provided by the user if it is between 0 and 1
if
(
alpha
>=
0
&&
alpha
<=
1
)
...
...
@@ -32,12 +33,12 @@ int main( void )
//![load]
/// Read images ( both have to be of the same size and type )
src1
=
imread
(
"../data/LinuxLogo.jpg"
);
src2
=
imread
(
"../data/WindowsLogo.jpg"
);
src1
=
imread
(
"../data/LinuxLogo.jpg"
);
src2
=
imread
(
"../data/WindowsLogo.jpg"
);
//![load]
if
(
src1
.
empty
()
)
{
std
::
cout
<<
"Error loading src1"
<<
std
::
endl
;
return
-
1
;
}
if
(
src2
.
empty
()
)
{
std
::
cout
<<
"Error loading src2"
<<
std
::
endl
;
return
-
1
;
}
if
(
src1
.
empty
()
)
{
cout
<<
"Error loading src1"
<<
endl
;
return
-
1
;
}
if
(
src2
.
empty
()
)
{
cout
<<
"Error loading src2"
<<
endl
;
return
-
1
;
}
//![blend_images]
beta
=
(
1.0
-
alpha
);
...
...
This diff is collapsed.
Click to expand it.
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