From 56cedfc4d218313cf0071ce07624525c66b69140 Mon Sep 17 00:00:00 2001 From: vskarlsruhe Date: Thu, 23 Feb 2017 11:43:30 +0100 Subject: [PATCH] Update AddingImages.cpp If-condition was always true (alpha = 0.5 is set in Line 19). Now the user input is checked to be between 0 and 1. This is correct in the tutorial code for OpenCV 2.4. --- samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp index 491ae7ad9e..d8024cd2b5 100644 --- a/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp +++ b/samples/cpp/tutorial_code/core/AddingImages/AddingImages.cpp @@ -27,7 +27,7 @@ int main( void ) std::cin>>input; // We use the alpha provided by the user if it is between 0 and 1 - if( alpha >= 0 && alpha <= 1 ) + if( input >= 0 && input <= 1 ) { alpha = input; } //![load]