mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #8282 from vskarlsruhe:patch-3
This commit is contained in:
commit
8e8da3f5b0
@ -9,6 +9,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function main
|
* @function main
|
||||||
@ -21,10 +22,10 @@ int main( void )
|
|||||||
Mat src1, src2, dst;
|
Mat src1, src2, dst;
|
||||||
|
|
||||||
/// Ask the user enter alpha
|
/// Ask the user enter alpha
|
||||||
std::cout<<" Simple Linear Blender "<<std::endl;
|
cout << " Simple Linear Blender " << endl;
|
||||||
std::cout<<"-----------------------"<<std::endl;
|
cout << "-----------------------" << endl;
|
||||||
std::cout<<"* Enter alpha [0-1]: ";
|
cout << "* Enter alpha [0-1]: ";
|
||||||
std::cin>>input;
|
cin >> input;
|
||||||
|
|
||||||
// We use the alpha provided by the user if it is between 0 and 1
|
// We use the alpha provided by the user if it is between 0 and 1
|
||||||
if( input >= 0 && input <= 1 )
|
if( input >= 0 && input <= 1 )
|
||||||
@ -32,12 +33,12 @@ int main( void )
|
|||||||
|
|
||||||
//![load]
|
//![load]
|
||||||
/// Read images ( both have to be of the same size and type )
|
/// Read images ( both have to be of the same size and type )
|
||||||
src1 = imread("../data/LinuxLogo.jpg");
|
src1 = imread( "../data/LinuxLogo.jpg" );
|
||||||
src2 = imread("../data/WindowsLogo.jpg");
|
src2 = imread( "../data/WindowsLogo.jpg" );
|
||||||
//![load]
|
//![load]
|
||||||
|
|
||||||
if( src1.empty() ) { std::cout<< "Error loading src1"<<std::endl; return -1; }
|
if( src1.empty() ) { cout << "Error loading src1" << endl; return -1; }
|
||||||
if( src2.empty() ) { std::cout<< "Error loading src2"<<std::endl; return -1; }
|
if( src2.empty() ) { cout << "Error loading src2" << endl; return -1; }
|
||||||
|
|
||||||
//![blend_images]
|
//![blend_images]
|
||||||
beta = ( 1.0 - alpha );
|
beta = ( 1.0 - alpha );
|
||||||
|
Loading…
Reference in New Issue
Block a user