Similar to the functionality available in Visual Studio I'd like to have a look at some of the variables in my code as images using PyCharm Community Edition 2016.1.4.
In my case it's a mask that is applied to an image later on, that I want to visually check during debug when hitting a breakpoint. So far I have tried adding the mask itself to the watch window, but then I only see the numerical values of the array. Then I tried adding an expression to the watch window:
cv2.imshow('mask', mask)
However, this then freezes the other windows when hitting a breakpoint and does not display the variable, so I added a second expression just afterwards:
cv2.imshow('mask', mask); cv2.waitKey(30)
This does the trick as it allows to actually display the content of the variable when hitting the breakpoint in a separate window called 'mask'. Unfortunately it still causes a freeze of the window showing the variable. Has someone an idea how to get around this issue?
I had similar problems, so I've just created OpenCV Image Viewer Plugin, which works as you expect. You can install it to any JetBrains IDE, which support Python (directly or via plugin).
https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With