do { cout << endl; cout << "Enter Your Blend Key from -11 to 10" << endl;
beta = 1.0;
cout << endl;
cin >> alpha;
if ((double)alpha >= (-11.0) && (double)alpha <= 10.1)
{
addWeighted(img, alpha, img2, beta - alpha, 0, des);
imshow("img", img);
waitKey(0);
imshow("ime1", img2);
waitKey(0);
imshow("Blended", des);
waitKey(0);
break;
}
else
{
cout << "Wrong Entry";
}
} while (false);// , cout << " Try Again!!!" << endl);
do
{
cout << "Enter Key" << endl;
char key = cv::waitKey(0);
cin >> key;
if (key == 'Q' || key =='q' || key == 'E' || key =='e' )
{
EXIT_SUCCESS;
}
} while (false);//, cout<<"Enter 'Q' or 'E' To Quit"<<endl);
system("pause");
return 0;
the first two waitkey all works but the last one isn't helping me to break out of the loop, except i change the argument to waitKey(1), which works and fail later. Am trying to get a user key to quit the program, so i need the code to break from the loop after displaying the image and ask the user if they want to quit... thanks in advance