OpenCV has released a plugin called Image Watch that can be used to display and monitor Image variables during debugging.

The official documentation: imagewatch.azurewebsites.net/ImageWatchH…

Image Watch is a plug-in for Microsoft Visual Studio that allows us to visualize images in memory (for example, CV ::Mat or IplImage_ objects) while debugging our applications. This can help track down errors or help us understand what a particular piece of code is doing (such as the transformation in this article’s sample code).

Download and install Image Watch

VS2012 – VS2015 marketplace.visualstudio.com/items?itemN…

VS2017

Marketplace.visualstudio.com/items?itemN…

VS2019

Marketplace.visualstudio.com/items?itemN…

Image Watch works with any existing project that uses OpenCV Image objects (for example, CV ::Mat).

Make sure that you are in Debug mode and that the breakpoint is set in the appropriate place to activate the Image Watch plug-in when debugging runs to the breakpoint. If the Image Watch window is not displayed, you can use the following method to call: Menu bar -> View -> Other Windows -> Image Watch to bring up the plug-in.

Note that the built-in “local” window in the VS IDE will display only text. The Image Watch plug-in is like another Locals window, but with an Image viewer built in. Like the Visual Studio Locals window, the Image Watch can be docked to the Visual Studio IDE. In addition, Visual Studio will remember whether we have Image Watch open and where it is between debug sessions. That is, just do this, and the next time we start debugging, the Image Watch will return to where we left off.

 

The old way

Blog.kylinj.com/2017/10/21/…