use cin for choice an operation
hi. I have below code and i want if I entered 0 then condition if (intensity1 > intensity6) be review and if i entered 1 then condition if (intensity1 < intensity6) be rewiew. ` int main(int argc, char* argv[]) { VideoCapture cap(0); // open the video camera no. 0
if (!cap.isOpened()) // if not success, exit program
{
cout << "Cannot open the video cam" << endl;
return -1;
}
int Darker = 0;
int Clearer = 1;
Mat frame;
namedWindow("MyVideo", CV_WINDOW_AUTOSIZE);
cout << "Difference Intensity: " << endl
<< "0---if Darker " << endl
<< "1---if Clearer " << endl; cin >> Darker;cin >> Clearer;
while (1)
{
//...
`
` if (intensity1 > intensity6) {
line(frame, pt25, pt26, Scalar(255, 255, 255), 1, 8, 0);
line(frame, pt27, pt28, Scalar(255, 255, 255), 1, 8, 0);
line(frame, pt29, pt30, Scalar(255, 255, 255), 1, 8, 0);
line(frame, pt31, pt32, Scalar(255, 255, 255), 1, 8, 0);
}
else
if (intensity1 < intensity6)
cout << "lotus89" << endl;`
I am very grateful if you help me.thanks a lot..
what's the problem , exactly ? (you somehow forgot to highlight it)
oh, and i'd rather have a single number with 3 states : 0:do_nothing, 1:lighter, 2:darker.
then, probably noone knows what your
if (intensity1 > intensity6) be review
statement means.I have two ROIs and two conditions that i consider Their differences in intensity(ROIs) for chioce an operation.I want Any time i run my program,only one condition be rewiew.For this reason, I want to use cin in start my program for choice a condition only.I hope that I could explain what I want Properly.
I write
cout << "Difference Intensity: " << endl << "0---if Darker " << endl << "1---if Clearer " << endl; cin >> Darker;cin >> Clearer;
for this reason.but I don't know what to dothis code run for each condition for separate.but if I want to have both condition in program and decision that what condition Be considered,what can I do?