Image Watch

Microsoft Free

Provides a watch window for visualizing in-memory images (bitmaps) when debugging native C++ code.

(33) Review
Visual Studio
2013, 2012
Download (30,943)
E-mail Twitter Digg Facebook
Add to favorites
Reviews (33)
Q and A (69)
Sign in to write a review
Sort by:

by Jaka Konda | Tue 3:55 PM

by vuki | Fri 8:18 AM

A must if you program with OpenCV

by bambambigelow | January 28 2015

this is an amazing extension! works like a charm and saves a lot of hassle while debugging opencv code

by Y.T. Tommy HU | January 08 2015

by Lukas Neumann1 | December 19 2014

Works like a charm, this add-in is a must for everyone working with OpenCV in Visual Studio.

by Elador | December 16 2014

THE best and most amazing plugin ever! Makes coding so much more productive, and more fun as well.

If you want one suggestion on what to improve, I'd say @mem(...). I don't needed it often, but when I'd need it, I most of the time can't get it to work. It's kind of documented, but I'm never sure: Do I put in the name of the variable? or '&variable'? or the address? or the address with 0x...? or...? and more often than not it's not working, and also not printing any error/debug information.

I think what would be useful as well is a small button that opens a menu that shows all the operators you can use, and their syntax - like a small documentation inside.

But those are just some tiny suggestions. It is incredible as it is!

by Mor CH | November 09 2014

absolutely useful and great, but I want this add-on for both Xcode and eclipse (Mac and Linux) very bad please.

by John Dance | September 12 2014

This makes debugging image handling so much easier. I love it! Thank you! The ability to extend to my image types (QImage/QPixmap) is a game changer.

by Rob42_ | August 04 2014

Thanks for this great extension to Visual Studio,
would like to see this open sourced to add even more features.

by Mudit Agrawal | June 24 2014

This is indeed a game changer! Debugging in-memory images has always been so hard in VS. The simple power of Image-Watch visualization, combined with the efficient operators can turn hours of debugging to minutes or seconds.

Great work!

by lin jingxian | April 06 2014

sounds good, but can not use with vs 2013 express ?

by V.N.V | February 23 2014

Just a note to say a simple Thank You to the author.

This extension is excellent.

It provides a "quicklook" into a sequence of images from a loop.

Without it, I'd be spending much more time on the problem. I'd need to save each image to disk, with a serialized name,
and bring each up individually in an external viewer.

by Daehoe Kim | January 28 2014

Excellent tool. I love it :)

by Chris Sienkiewicz | December 26 2013

Fantastic add in, makes working with images so much easier.

by Akhil Prem | November 19 2013

Very handy when working with images. I love it that I can use it with custom image types using NatVis.

by Trass3r | November 14 2013

This is a lifesaver!

by sarthakpati | October 01 2013

by LevonGn | September 26 2013

by Alessandro R Silva | September 07 2013

This is one of the reasons why i develop in Windows in openCV. A Extraordinary tool, with no match.

by Son D Tran | August 30 2013

1 - 20 of 33 Items   
Sign in to start a discussion

  • Working only with IplImage* and not with MAT
    3 Posts | Last post January 29, 2015
    • Hi,
      First let me say that this add on, is totally stunning, and a must for every developer in the image processing field :)
      Second I tried to install it with VS 2012, and interesting thing is that it is working, but only with variables like iplimage*, and not (funny...) with cv::Mat....
      What should I tune in order to make it operational with openCv2?
      ( I tried all the native code tune in the debugger, tried #prgama unmanged, and tried to attach to process... all those thing didn't work.)
      I still see in the debugger when pressing on the cv::Mat the :
      rows, cols and not width height.)
      Funny thing is that Native viewer work fine with those variables.
      Any idea ? 
      And thanks again for amazing tool.
    • Hi ODPR,
      thanks very much for your feedback! 
      It is curious that IPL images work fine and cv::Mat objects don't--I haven't seen that before. 
      The fact that you see "cols" and not "width" means that Visual Studio doesn't pick up the natvis definition only for cv::Mat. 
      One possibility is that the Native Viewer extension defines its own visualizer for cv::Mat which interferes with Image Watch. Have you tried uninstalling Native Viewer? If you try this, double check you have no cv::Mat related entries in your autoexp.dat file after uninstalling(
      Let me know if that helps.
    • Hi Wolf,
      Thanks for the answer,
      your idea seems logical, however, I can't find anywhere how to uninstall native viewer.
      I tried to remove manually the line that native viewer install in the autoexp.dat, but still it works in the debugger ( so probably there is some other hidden places that it put files.).
      Any idea how to uninstall Native Viewer?
  • Pixel strides
    2 Posts | Last post January 28, 2015
    • Dear Wolf,
      the @band operator allows me to display individual channels of an image. I am not sure whether you do internally copy in that case, or whether you already have a pixel stride for this operator. If there were a pixel stride available, it would be very useful to be able to expose it publicly. Do you think that would be possible.
      It would allow to display types resembling view's to image channels. It might also improve the support for some rare cv::Mat types since these already support strides for each dimension internally.
      Thanks again for your great work,
      p.s. Is there any way to help contribute to Image Watch besides posting visualizers (as I did e.g. in March 2013 for ITK)? I mean contributing on the implementation side?
    • Hi Hauke,
      thanks for your great suggestion. Yes, pixels strides would be useful.. Right now the @band operator assumes that the offset between two pixels within a channel is completely determined by the pixel format. This offset is used when copying/converting the selected band into an RGB image for display in the Visual Studio IDE.
      Regarding contributions please PM me at [name of this extension]
  • Proposal for 'slice' operator
    1 Posts | Last post January 23, 2015
    • Dear Wolf,
      you already offer an @band operator. Since more and more people (esp. from the medical domain) are working with 3D images these days and I was wondering whether you could add an @slice operator.
      Today, I can mimic the behavior by using @mem but that is a little bit cumbersome.
      Regards, Hauke
  • VS 2015
    3 Posts | Last post December 21, 2014
    • Dear Wolf,
      When can we expect Image Watch for Visual Studio 2015 (Preview)? :-) Looking forward to it, so I can start using the updated 2015 compiler and STL.
      Thank you very much for Image Watch, and even more for making it available for free. It's THE most amazing tool ever. Ever! It makes coding in C++ surpass Matlab, and increases productivity (and fun) by an uncountable amount.
      Cheers :)
    • Hi Elador, 
      thanks so much for your feedback! The 2015 update should be out very soon :)
    • Hi Wolf,
      Awesome to hear that a VS2015 update is coming very soon! It's the last bit missing to do the switch ;-)
      Thank you for your reply! Keep up the awesome work!
  • VS 2013 update 2 compatibility
    3 Posts | Last post December 04, 2014
    • Hello,
      extension does not install on VS 2013 update 2
      full VS spec:
      It did install for VS 2012 though - VS 2013 was simply not detected
    • Hmm .. have you tried installing any other extensions?
    • Hey,
      a little necro, but I've just came back to this problem and found solution.
      As I said ealier (quite unprecisely) downloading installer from website and running it with Microsoft Visual Studio Version Selector did't work.
      Installing it via plugin manager in VS did work though.
      @Wolf, yes, I've plenty of plugins installed, like UnityVS Tools or Nvidia's CUDA. Not sure if it matters anymore though :)
      Have a nice day folks
  • Negative Strides
    5 Posts | Last post December 02, 2014
    • First of all: Thank you for this great Extension!
      I noticed that i have problems displaying images with negative strides. Are they not supported or do i have to take some special steps for image watch to recognize negative strides?
    • Thanks a lot for your feedback! 
      You are right, negative strides are not supported at this point. One possible workaround is to calculate the address of the first pixel row in the natvis file and then pretend the image has a positive stride. Note that you can do basic math in the natvis:
      <Item Name="[data]">m_lastRowPtr - ((m_numRows-1) * m_stride)</Item>
      Your image will be displayed upside-down, of course, but that could still be valuable for many debugging scenarios. Also, if you do need to see the image in its correct orientation you can use the @flipv operator in Image Watch's watch list (see Image Watch documentation, "Image Operators").
    • Hi Wolf,
      thank you very much for your suggestions.
      I got that working! 
      However: I can have both positive and negative strides in one image type. I tried to check if my stride is "> 0" or "< 0" but i can´t find a statement that is valid in natvis syntax and i cant find a documentation. 
      Do you know where the syntax and valid operators are described? 
      I found a lot of Examples using equal and not equal but none using other comparisons.
    • I worked around this problem by using Bit shift operations: 
      Check if number is negative: (ystride >> (sizeof(int) * 8 - 1)) == -1
    • As Y-Strides are working fine i just hit the next problem. Some of the images i need to support also have X-Strides. Is there any plan to support these in futures versions?
  • Dump file formats
    10 Posts | Last post December 01, 2014
    • Hi,
      are there any rules associated with dumping to example a JPG or PNG file?
      I created a natvis file for our image data, but I can only dump to a .BIN file.
    • Hi Joris,
      the current rule is that images with 1, 3, or 4 channels can be saved as .jpg or .png. We might remove that restriction in the future. As a workaround for now you can extract a single channel using the @band operator in the watch window. The result will be a single-channel image which can be saved as .jpg or .png.
      That said, at some point we were considering an option that would allow you to save any image type in a simple (but potentially very inefficient) file format (like OpenCV's XML image format). That feature hasn't made it to the top of the list yet, but if that is something of interest, please let us know here in the forum.
    • Hi Wolf,
      Our image data is in a single channel. The natvis file has the following statement:
      <Item Name="[channels]">1</Item>
      But still no luck, i tried using the @band option as well. Has the BIN file a special format? If I know that is is sufficient for me, I can build it in our own viewer.
      With kind regards,
    • Hi Joris, 
      what are the other attributes of your image (size, pixel format)? 
      The bin file has a special internal format that I cannot publish, unfortunately. 
    • Hi Wolf,
      The data structure is as follows:
      template <typename T>
      class ImageBase
      	T *     Pointer;
      	int     Stride;
      	int     Width;
      	int     Height;
      Natvis type:
      <Type Name="ImageBase&lt;*&gt;">
      <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
      <Type Name="ImageBase&lt;*&gt;">
        <Synthetic Name="[type]" Condition='strcmp("short", "$T1") == 0'>
        <Synthetic Name="[type]" Condition='strcmp("unsigned short", "$T1") == 0'>
        <Synthetic Name="[type]" Condition='strcmp("unsigned char", "$T1") == 0'>
        <Item Name="[channels]">1</Item>
        <Item Name="[width]">Width</Item>
        <Item Name="[height]">Height</Item>
        <Item Name="[data]">Pointer</Item>
        <Item Name="[stride]">Stride*sizeof($T1)</Item>
      I'm using Visual Studio 2012 Update 4 with Image Watch 1.5.1103.0.
      The image has a width, height and stride of 1024. Stride is in pixels.
      With kind regards,
    • Hi Joris,
      I just tested your code. I was able to dump images to a standard image file (png) as long as the pixel format was unsigned. The reason why it doesn't work for signed pixel formats (INT16) is that Image Watch doesn't have a default mapping from signed to unsigned pixel values (e.g. 0-255 in an 8bit png).
      The @band operator does not change the pixel type. However, if your pixel values are all >= 0, you could use @scale(img, 1.0/32767), which will produce a FLOAT32 image (values between 0 and 1) that can be dumped to png. 
      Does that help?
    • Hi Wolf,
      The scale function does help but why not make a raw dump instead? Several tools provide a raw import with the option of how to interpret the raw data. Maybe that is a possibility?
      With kind regards,
    • Hi Joris,
      dumping to a raw format is definitely something we've been thinking about. The main reason that feature is not there now is that we didn't have the time to implement it yet. :/ 
    • Hi Wolf,
      well, the holiday season is coming up. I have a wish and you have some free time ;)
      With kind regards,
    • Watch out for the Visual Studio Debug (=VSD) pluging.
      It does dumping of any sort of data to bin files for you.
      It might not directly know about OpenCV image buffers but it can use any general type of symbol including buffer pointers and sizes as it's input.
  • Extention Crash IDE on huge matrices
    2 Posts | Last post November 07, 2014
    • Hi! Great extention, i use it regulary and it helps a lot.
      Recently I had to deal with huge matrices (65536x1000000). When such matrix is added to ImageWatch, the extention fails with assertion message.
      I'm to not be able to see such big image, but crashing IDE is disturbing :) 
    • Hi Eugene,
      thanks for your feedback. Great to hear you find the tool useful! Sorry about the inconvenience with the assert on the huge image .. we apparently had an issue with our build system that would keep asserts in the code even in a release build :/ (see also "Assertion Error" posted on July 30, 2014). The upcoming update contains a fix for this.
  • Can not see any variables in Locals/Watch
    5 Posts | Last post November 03, 2014
    • Hi,
      Thank you very much for this wonderful tool. I installed 1.5.1103.0 with visual studio professional 2012. I created a .natvis file for my own struct type and stored it in the \Visualizers\ directory. The ImageWatch.txtb says it detected and registered my type. When I debug in x64 mode and break at the point where I have the data, I don't see this variable in ImageWatch Locals/Watch window although I have added the variable manually to visual studio watch window. So no list is populated. Following is my code and .natvis file. Any idea why no list is populated?
      struct MyDisplay{
      FLOAT32* m_pBuffer;
      INT32 m_iWidth;
      INT32 m_iHeight;
      INT32 m_iBytesPerLine;
      <?xml version="1.0" encoding="utf-8"?>
      <AutoVisualizer xmlns="">
        <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>
        <Type Name="MyDisplay">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        <Type Name="MyDisplay">
            <Synthetic Name="[type]">
            <Synthetic Name="[channels]">
            <Item Name="[width]">m_iWidth</Item>
            <Item Name="[height]">m_iHeight</Item>
            <Item Name="[data]">m_pBuffer</Item>
            <Item Name="[stride]">m_iBytesPerLine</Item>
    • Hi SarSwa,
      thanks for your feedback! Your natvis file looks good. A few questions: are the properties [type], [channels], etc. showing up in the built-in (VS, not Image Watch) Locals/Watch window? Does it work in x86? Are you debugging in mixed-mode by any chance?
    • Hi Wolf,
      Thanks for the reply.
      I dont quite understand the question, do you mean I see the "type" in VS watch window?  I know the data is of FLOAT32 kind and I can see the data in watch window. "type", "channel" etc. are not variables right?
      I choose x64 and then debug, I am sure I am not using mixed. Also for some reason my application would not run in x86 mode sorry could not do much.
    • When you look at a variable of type MyDisplay in the normal VS watch window, you can "expand" the variable view so that you can see its members m_pBuffer, m_iWidth, etc. Now, if you have the natvis installed, this expanded view changes to [type], [width], ... This is what Image Watch reads, so unless you can't see [type] etc, when expanding the variable view in the VS watch window, natvis is not working. 
      One common reason for natvis not working is debugging in managed or mixed (=native AND managed) mode. 
      Does that help?
    • Ok so I don't see [type], [width] I only see the regular expanded view where I see all members and their values. I will check more on managed mode as I am not sure if I am in such a mode.
      Thanks so far it is helpful.
  • Raw buffer visualization
    2 Posts | Last post October 23, 2014
    • Hi,
      It would be very useful to be able to watch raw buffers at debug time. There are cases when you only have the buffer, without additional metadata and it would be very useful to be able to specify image size/format at debug time, as you do with raw pointers in the watch list.
    • This is possible with @mem(address, type, channels, width, height, stride): interpret raw memory as pixels ...
1 - 10 of 69 Items