简体   繁体   English

在Visual Studio中调试非托管C ++图像

[英]Debugging unmanaged C++ images in Visual Studio

I do write lots of image processing code with lots of different images involved on unmanaged C++ under Visual Studio 2010. I want to be able to watch them almost as easily, as a simple identifier while step-by-step debugging. 我确实编写了很多图像处理代码,其中包含在Visual Studio 2010下与非托管C ++有关的许多不同图像。我希望能够像逐步调试时的简单标识符一样轻松地观看它们。

My current solution is to use some function which exports image in Matlab console. 我当前的解决方案是使用一些在Matlab控制台中导出图像的功能。 It is ok, but requires modification to source code, while I want to do it just while debugging. 可以,但是需要修改源代码,而我想在调试时进行修改。 So the best option is just image popping up while hovering containing variable by mouse. 因此,最好的选择是鼠标悬停包含变量时弹出图像。 But writing some command ExportToMatlab(image) in Command Window is enough. 但是在命令窗口中编写一些命令ExportToMatlab(image)就足够了。 I don't know how to do even this, however. 我什至不知道该怎么做。

There is the very similar question "Debugging image rendering in Visual C++, any helpful add-ins?" 有一个非常相似的问题“在Visual C ++中调试图像渲染,是否有有用的加载项?” , but it is too old and I found no acceptable answers in that discussion. ,但它太旧了,在该讨论中我没有找到可接受的答案。 Some tools are .NET-based (see image below), some requires additional code to be written (that's what I currently am using), and some projects are frozen or unfinished. 一些工具是基于.NET的(请参见下图),一些工具需要编写其他代码(这是我当前正在使用的工具),并且一些项目被冻结或未完成。

DebuggerVisualizer的屏幕截图

I can spend some time on implementing appropriate solution, so links to some good guides on how to customize debugger visualizer in VS are welcome too. 我可以花一些时间来实施适当的解决方案,因此也欢迎链接到一些不错的指南,这些指南如何在VS中自定义调试器可视化程序。

Update 更新资料

I've created a Visual Studio extension based on Expression Evaluator Add-In . 我已经基于Expression Evaluator加载项创建了一个Visual Studio扩展。 It is available to download from its SourceForge project page, called NativeViewer . 可从其SourceForge项目页面(称为NativeViewer)下载该文件 Check for description on how to use it. 检查有关如何使用它的描述。

I can't actually believe that nobody suggested Image Watch yet. 我真的不能相信没有人建议Image Watch It's the most amazing add-in ever. 这是有史以来最惊人的插件。 It shows you a view with all your Mat variables (images (gray and color), matrices) while debugging, there's useful stuff like zooming or contrast-stretching and you can even apply more complex functions directly in the plugin in real-time. 它向您显示一个视图,其中包含调试时的所有Mat变量(图像(灰色和彩色),矩阵),还有诸如缩放或对比度拉伸之类的有用信息,您甚至可以直接在插件中实时应用更复杂的功能。 It makes debugging of any kind of image operations a breeze and it's immensely helpful if you do calculations and linear algebra stuff with your cv::Mat matrices. 它使任何类型的图像操作调试变得轻而易举,如果您使用cv :: Mat矩阵进行计算和线性代数运算,则将非常有用。

在此处输入图片说明

Just for history: I've implemented my own solution based on Expression Evaluator Add-In . 只是为了历史:我已经基于Expression Evaluator Add-In实现了自己的解决方案。 It doesn't fit well enough, but I was able to implement all what I needed. 它不够合适,但是我能够实现我所需要的一切。

Update 更新资料

I've created a publicly available Visual Studio extension. 我创建了一个公共可用的Visual Studio扩展。 It is available to download from its SourceForge project page, called NativeViewer . 可从其SourceForge项目页面(称为NativeViewer)下载该文件 Check for description on how to use it. 检查有关如何使用它的描述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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