Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 400
Ekalic Avatar asked Sep 29 '22 18:09

Ekalic


2 Answers

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

like image 119
YScharf Avatar answered Oct 27 '22 01:10

YScharf


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.

like image 28
Christopher Peterson Avatar answered Oct 27 '22 00:10

Christopher Peterson