一直以来,很多时候都是用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
下面以官网上的代码进行简介:
- // Test application for the Visual Studio Image Watch Debugger extension
- #include <iostream> // std::cout
- #include <opencv2/core/core.hpp> // cv::Mat
- #include <opencv2/highgui/highgui.hpp> // cv::imread()
- #include <opencv2/imgproc/imgproc.hpp> // cv::Canny()
- using namespace std;
- using namespace cv;
- void help()
- {
- cout
- << ”—————————————————-“ << endl
- << ”This is a test program for the Image Watch Debugger ” << endl
- << ”plug-in for Visual Studio. The program loads an ” << endl
- << ”image from a file and runs the Canny edge detector. ” << endl
- << ”No output is displayed or written to disk.”
- << endl
- << ”Usage:” << endl
- << ”image-watch-demo inputimage” << endl
- << ”—————————————————-“ << endl
- << endl;
- }
- int main(int argc, char *argv[])
- {
- help();
- if (argc != 2)
- {
- cout << ”Wrong number of parameters” << endl;
- return -1;
- }
- cout << ”Loading input image: ” << argv[1] << endl;
- Mat input;
- input = imread(argv[1], CV_LOAD_IMAGE_COLOR);
- cout << ”Detecting edges in input image” << endl;
- Mat edges;
- Canny(input, edges, 10, 100);
- return 0;
- }
// Test application for the Visual Studio Image Watch Debugger extension
1.采用debug模式进行编译,设置一个断点
2.查看debug模式下哪些变量是可见的:
3. 查看debug模式下哪些变量是可见的
4.在运行debug模式下,运行到断点处的时候,可以打开image watch插件进行查看: