Skip to content

Commit ed9c924

Browse files
authored
Code easier to read now
Increase readability by using namespace std
1 parent dcbed8d commit ed9c924

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <iostream>
1010

1111
using namespace cv;
12+
using namespace std;
1213

1314
/**
1415
* @function main
@@ -21,23 +22,23 @@ int main( void )
2122
Mat src1, src2, dst;
2223

2324
/// Ask the user enter alpha
24-
std::cout<<" Simple Linear Blender "<<std::endl;
25-
std::cout<<"-----------------------"<<std::endl;
26-
std::cout<<"* Enter alpha [0-1]: ";
27-
std::cin>>input;
25+
cout << " Simple Linear Blender " << endl;
26+
cout << "-----------------------" << endl;
27+
cout << "* Enter alpha [0-1]: ";
28+
cin >> input;
2829

2930
// We use the alpha provided by the user if it is between 0 and 1
3031
if( alpha >= 0 && alpha <= 1 )
3132
{ alpha = input; }
3233

3334
//![load]
3435
/// Read images ( both have to be of the same size and type )
35-
src1 = imread("../data/LinuxLogo.jpg");
36-
src2 = imread("../data/WindowsLogo.jpg");
36+
src1 = imread( "../data/LinuxLogo.jpg" );
37+
src2 = imread( "../data/WindowsLogo.jpg" );
3738
//![load]
3839

39-
if( src1.empty() ) { std::cout<< "Error loading src1"<<std::endl; return -1; }
40-
if( src2.empty() ) { std::cout<< "Error loading src2"<<std::endl; return -1; }
40+
if( src1.empty() ) { cout << "Error loading src1" << endl; return -1; }
41+
if( src2.empty() ) { cout << "Error loading src2" << endl; return -1; }
4142

4243
//![blend_images]
4344
beta = ( 1.0 - alpha );

0 commit comments

Comments
 (0)