简体   繁体   中英

Debug OpenCV images in Python

Visual Studio allows to visualize OpenCV images using Image Watch plugin ( https://visualstudiogallery.msdn.microsoft.com/e682d542-7ef3-402c-b857-bbfba714f78d ) during debug. This is very helpful for computer vision coding.

What is the proffered way to visualize images in Python binding to OpenCV? I am aware that it is possible to use cv2.imshow("name", image) but that is not very practical in contrast to Image Watch which allows to show many images at the same time and automatically does the update after change.

Is there any alternative to Image Watch for Python?

I think maybe you'll want to look at Visual-Logging . It can produce a rather nice collection of your output that you can just open up in a browser. It is pip installable like so:

pip install visual-logging

Here is a page with a concise walkthrough that shows how it is used.

It's not nearly as fancy as that Visual Studio tool, but it might be your best option that already exists.

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 use VSCode , you can try the simply_view_image_for_python_opencv_debugging VSCode-Extension .

https://marketplace.visualstudio.com/items?itemName=johnguo.simply-view-image-for-python-opencv-debugging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM