ImageWatch安装-VS2017

imagewatch是一个优秀的查看图片数据的插件,解决了调试opencv程序时查看图片不方便的问题。

我的vs2017版本为15.4,使用Andrei的方法同样安装成功。

 

For Visual Studio 2017 "support": 

1. Download the extension (ImageWatch.vsix) and open it using WinRAR

2. From inside the bundle, open "extension.vsixmanifest" (using Notepad/Visual Studio, or any XML editor)

3. Edit line number 11 to match: "<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0]" />"

4. Edit line number 15 to match: "<Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" Version="[15.0]" />"

5. Save the file and update it in the archive (select Yes in WinRAR dialog)

6. Install the extension (it will complain that it might not be compatible, but it works)

在这里,不要自作聪明将15.0改为15.4,否则安装失败。

附上修改后的安装文件,双击打开即可安装成功:

http://download.csdn.net/download/f1121814098/10112641

 

使用方法:

一直以来,很多时候都是用Matlab来进行图像处理和算法研究,主要是觉得其可以方便的查看图像、像素点等等(本人是菜鸟,如果是高手可以快速用C语言实现的请指导),所以一直以来都是matlab来写算法,不过这样写有个大麻烦就是转化成工程代码还得再次写C/C++,离工程应用总觉得差那么一步。最近刚好看到这个VS2012以后的插件Image Watch可以代替部分matlab里面显示图像信息很方便的功能,很受用。

这位仁兄是发现这个功能比较早的:http://www.cnblogs.com/liu-jun/p/3161654.html

基本功能都介绍的很详细,几个链接如下:插件的下载链接:https://visualstudiogallery.msdn.microsoft.com/e682d542-7ef3-402c-b857-bbfba714f78d

opencv对插件的介绍:http://opencv.org/image-debugger-plug-in-for-visual-studio.html

详细的介绍文档:http://docs.opencv.org/2.4/doc/tutorials/introduction/windows_visual_studio_image_watch/windows_visual_studio_image_watch.html#windows-visual-studio-image-watch

研发团队对该插件的详细介绍:http://research.microsoft.com/en-us/um/redmond/groups/ivm/imagewatchhelp/imagewatchhelp.htm#_Toc351981444

下面以官网上的代码进行简介:

 

 

 
  1. // Test application for the Visual Studio Image Watch Debugger extension

  2.  
  3. #include <iostream> // std::cout

  4. #include <opencv2/core/core.hpp> // cv::Mat

  5. #include <opencv2/highgui/highgui.hpp> // cv::imread()

  6. #include <opencv2/imgproc/imgproc.hpp> // cv::Canny()

  7.  
  8. using namespace std;

  9. using namespace cv;

  10.  
  11. void help()

  12. {

  13. cout

  14. << "----------------------------------------------------" << endl

  15. << "This is a test program for the Image Watch Debugger " << endl

  16. << "plug-in for Visual Studio. The program loads an " << endl

  17. << "image from a file and runs the Canny edge detector. " << endl

  18. << "No output is displayed or written to disk."

  19. << endl

  20. << "Usage:" << endl

  21. << "image-watch-demo inputimage" << endl

  22. << "----------------------------------------------------" << endl

  23. << endl;

  24. }

  25.  
  26. int main(int argc, char *argv[])

  27. {

  28. help();

  29.  
  30. if (argc != 2)

  31. {

  32. cout << "Wrong number of parameters" << endl;

  33. return -1;

  34. }

  35.  
  36. cout << "Loading input image: " << argv[1] << endl;

  37. Mat input;

  38. input = imread(argv[1], CV_LOAD_IMAGE_COLOR);

  39.  
  40. cout << "Detecting edges in input image" << endl;

  41. Mat edges;

  42. Canny(input, edges, 10, 100);

  43.  
  44. return 0;

  45. }

该代码是一个简单的图片读入,然后进行边缘处理的代码,根据该代码,进行图片显示的步骤如下:

 

1.采用debug模式进行编译,设置一个断点

2.查看debug模式下哪些变量是可见的:Debug ‣ Windows ‣ Locals

3. 查看debug模式下哪些变量是可见的

4.在运行debug模式下,运行到断点处的时候,可以打开image watch插件进行查看:View ‣ Other Windows ‣ Image Watch

这个时候可以清楚的在Image watch窗口里面看到所有的图像Mat,然后点击就可以显示每个图像了,在图像显示区域G进行显示。这个插件做的比较好的就是,可以实时显示鼠标的坐标(H区域)和像素值,还可以通过鼠标滚轮进行放大缩小等,详细的可以参考链接介绍。

至此,基本的类似Matlab显示图像和查看像素值等功能已经完成,除了这个之后,该插件还有一些很厉害的功能,在图片区域点击鼠标右键可以看到这些功能

主要是Link views这个功能比较强大,它可以在原始图像上选择一块区域,然后设置好,再点击后续的mat,就可以看到其他图像在设置区域内的变化,这个很强大!可以实时查看局部区域图像处理的结果。

其他的功能还有缩小和放大等,基本和matlab差不多,可以放大到像素级的,然后通过Link views查看局部的像素值随着算法运行而改变的情况等等。

差不多这些处理步骤在基本的图像算法里面就够用了,基本可以替代matlab的一些图像显示的功能了,当然还有更多的功能,请参见http://research.microsoft.com/en-us/um/redmond/groups/ivm/imagewatchhelp/imagewatchhelp.htm

转载于:https://my.oschina.net/u/523053/blog/1841881

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值