I was also having issues with this exact opencv version.. imshow behavior was flaky. Bumping it to 4.4 fixed it.