Trackbars sometimes fail to show up

asked 2020-07-22 15:56:04 -0600

I have been using cv2's Trackbar gui functionality in Python for a couple months now, with no problems until today. I had been using open cv 4.2.0, but switched to most recent (4.3.x) today after these problems began. Upgrading the version did not fix the problems. I can't provide much code because of IP, but the problem is not reproducible anyways - the code runs fine on my coworker's computer, and occasionally works on mine today. Like I said, before today everything worked fine on this exact same code. No changes were made today and it just started having trouble.

windowName = "Whatever you want to call the window" cv2.namedWindow(windowName, cv2.WINDOW_NORMAL) cv2.moveWindow(windowName, 0, 0)

Normally, this causes my image window with trackbars to open at a reasonable size, bound to the top left corner of my screen. Starting today, the window would still be bound to the corner, but would be very strangely sized (long and slender in the vertical direction). Some trackbar title text would be visible, and the image would be visible but obviously very skewed. Stretching out the window or hitting maximize made the window & image normal, but when I do that, there are no trackbars present. Just all the trackbar titles in a useless arrangement.

Any ideas?

The way the trackbar window naturally opens The trackbar window after maximizing

edit retag flag offensive close merge delete

Comments

os ? how did you install it ? which gui (qt/gtk) ?

berak gravatar imageberak ( 2020-07-23 03:41:54 -0600 )edit
1

windows 10, pip, gui is just built in oCV trackbar functionality, not sure beyond that. I ended up fixing it with a manual resize right after the manual moveWindow.

SeanStephensenAIRM gravatar imageSeanStephensenAIRM ( 2020-07-23 11:15:15 -0600 )edit