1

I have this kind of code at the end of my whole code . This is the command to close the window when i click on letter 'e'

if   cv2.waitKey(0) & 0xFF == ord("e") :
     cv2.destroyWindow('Train Device')
break   

I just want to close only a specific window when i am clicking on the letter (e) but when i use this one it close everything all the frames and not only the specific one. 'Train Device' is name of my window. When am i doing wrong?

1 Answer 1

3

I think the problem is that the break must be aligned inside the if, to be performed only in the case the condition is satisfied. If not, it will break at first step of your execution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.