Image Watch

Microsoft Free

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

Microsoft
(47) Review
Visual Studio
2015, 2013, 2012
Download (66,297)
4/22/2015
1.5.1106.0
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (47)
Q and A (100)
Sign in to write a review
Sort by:

by Chris Varnsverry | August 17 2016

Useful but incredibly buggy, and difficult to get valid natvis working with ImageViewer. Could do with some diagnostic output. and some natvis only work in 2013 and not 2015.

by Ernest Galbrun | July 19 2016

Excellent tool, a must-have for image processing developers.

by LotosBluete | June 14 2016

Was easy to adapt to our own internal image format.
Thanks a lot

by ZygfrydWieszok | June 08 2016

Brilliant extension. Ultimately handy when working with OpenCV.

by Luka Lukic | September 20 2015

by KayleXuan | September 13 2015

Never have I seen a more powerful tool than this one in img processing.

by FlorianG73 | August 25 2015

Exxxcellent tool ! Very helpfull for debuging.

Will get the fifth star when support for 1Bpp and CMYK images will be available.

by Goran Dubajic | August 06 2015

Great tool!
Bug: debugging from VS2015 with platform toolset VS2013 in Image Watch it states [invalid] for an image which is correctly displayed when debugging from VS2013. If platform toolset is VS2015 everything works OK.

by olvrw | July 22 2015

by StevenHickson | July 17 2015

I really can't say enough about this plugin. It makes debugging for computer vision much easier and faster.
The visualization of custom classes is easy and also a great addition.

by zzdrghost | May 05 2015

用起来非常方便!

by SergBabiychuk | April 16 2015

Great tools!
But I would like to see support:
1) for Qt5 objects: QImage,QPixmap(QBitmap)
2) for any pointers, with user selection of image parameters while debugging

by Baris Demiroz | March 24 2015

by Eejdoowad | March 13 2015

by Jaka Konda | March 03 2015

by vuki | February 27 2015

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 Pat__ | 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!

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


  • Difference in behaviour between 2013 and 2015
    1 Posts | Last post August 17, 2016
    • The following natvis works with Image Viewer in 2013 but not in 2015:
      
      <Type Name="MyType">
          <Expand>
            <Synthetic Name="[type]" Condition="thing == 0">
              <DisplayString>FLOAT16</DisplayString>
            </Synthetic>
            <Synthetic Name="[channels]">
              <DisplayString>RGBA</DisplayString>
            </Synthetic>
            <Item Name="[width]">memberPointer->data.width</Item>
            <Item Name="[height]">memberPointer->data.height</Item>
            <Item Name="[data]">memberDataPointer</Item>
            <Item Name="[stride]" Condition="thing == 0">pitchinpixels * 2 * 4</Item>
          </Expand>
        </Type>
      
      Although try as i might I can't get it to honour the RGBA, it always renders as BGRA.
      
      Please open source this so we can fix it!!
  • User type won't display using natvis, but does using @mem
    1 Posts | Last post July 22, 2016
    • I'm trying to get QImage to work with this. For debugging purposes, I am using the following .natvis definition:
      
        <Type Name="QImage">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        </Type>
      
        <Type Name="QImage">
          <DisplayString>{{UINT8, 4 x 21 x 295}}</DisplayString>
          <Expand>
            <Synthetic Name="[type]">
              <DisplayString>UINT8</DisplayString>
            </Synthetic>
            <Item Name="[channels]">4</Item>
            <Item Name="[width]">295</Item>
            <Item Name="[height]">21</Item>
            <Item Name="[data]">((Qt5Guid.dll!QImageData*)d)->data</Item>
            <Item Name="[stride]">1180</Item>
          </Expand>
        </Type>
      
      The ImageWatch log shows this getting picked up (+ Found type QImage ... + -> Registering QImage) and my Autos/Watch windows show the correct stuff underneath, so I know the natvis is working.  However, I still get invalid image. The catch here, is that I can use almost the exact same definition with @mem and it works!
      
      @mem(((Qt5Guid.dll!QImageData*)img.d)->data,UINT8,4,295,21,1180)
      
      Note: img is the local variable, hence the need for it in @mem.  The above expression for the data ptr, and the [data] element both show in the debugger with the same value and type, unsigned char*.  If I change the natvis to hardcode the address as 0x06a10000, it still says invalid!
      
      At this point it's either a typo that's become invisible to me, or some configuration error.  If there was a more useful level of logging, that would probably have pinpointed my mistake by now.
      
      I'm also very thankful that you guys put this together, but if you're not going to actively maintain it, open source it so we can fix things.  I've spent more time trying to debug ImageWatch then my actual program..
      
      
  • Remote debugging with Image Watch causes Visual Studio to freeze
    1 Posts | Last post July 05, 2016
    • Thanks for the amazing extension. I am using Visual Studio to remotely deploy projects on linux, everything works fine but if I have Image Watch enabled it will cause Visual Studio to freeze and goes not responding. Any suggestions to fix this issue ?
      
      Many thanks
  • Bug of showing the part of an image using cv::Range if containing the last row
    1 Posts | Last post June 22, 2016
    • Image Watch has problems of showing the part of an image using cv::Range if containing the last row. This bug has also been reported on stackoverflow: http://stackoverflow.com/q/37963764/2589776
      
          cv::Mat B = A(cv::Range::all(), cv::Range::all());           // no problem
          cv::Mat B = A(cv::Range(0, A.rows - 1), cv::Range::all());   // no problem
          cv::Mat B = A(cv::Range(0, A.rows), cv::Range::all());       // have problem, if contain the last row
  • Invalid Images
    2 Posts | Last post May 29, 2016
    • I'm attempting to get a template image class to be displayed, but all I get are invalid images.  I'm able to draw the images to the screen, output them to a file, etc, so I'm pretty sure all the data is correct.  My natvis file gets loaded correctly by the debugger (I can see all the various data fields, and they all have correct values).  Here's a simplified version of my class and the natvis file:
      
      namespace tltImaging
      {
      
      template <typename T>
      class cImage:public cImageBase
      {
      public:
      ...
      private:
           int mNumChannels;
           int mWidth;
           int mHeight;
           T*  mData;
      };
      }
      
      <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
        <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>
        <Type Name="tltImaging::cImage&lt;*&gt;">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        </Type>
      
        <Type Name="tltImaging::cImage&lt;*&gt;">
          <Expand>
            <Synthetic Name="[type]" Condition='strcmp("unsigned char", "$T1") == 0'>
              <DisplayString>UINT8</DisplayString>
            </Synthetic>
            <Item Name="[channels]">mNumChannels</Item>
            <Item Name="[width]">mWidth</Item>
            <Item Name="[height]">mHeight</Item>
            <Item Name="[data]">mData</Item>
            <Item Name="[stride]">mWidth*mNumChannels*sizeof($T1)</Item>
          </Expand>
        </Type>
      </AutoVisualizer>
    • Hi, I met the same problem, but finally I found out that the Image Watch works only if you put the .natvis under this directory "C:\Users\***\Documents\Visual Studio 2015\Visualizers", as is instructed in the help page. 
      
      Otherwise even though the Visual Studio shows the debug information, Image Watch won't recognize it. 
      
      Wish you good luck :)
  • Does not work in VS2015 Update 2 with my type
    3 Posts | Last post April 26, 2016
    • Hello.
      
      Bellow the minimum reproducible code:
      
      #include "stdafx.h"
      #include <windows.h>
      class TestImage {
      public:
      	virtual ~TestImage() {
      		delete[] pData;
      	}
      protected:
      	BYTE* pData;
      	BITMAPINFO m_Bmi;
      };
      
      class TestImage8bit : public TestImage {
      public:
      	TestImage8bit(int Rows, int Cols) {
      		m_Bmi.bmiHeader.biWidth = Cols;
      		m_Bmi.bmiHeader.biHeight = Rows;
      		m_Bmi.bmiHeader.biBitCount = 8;
      		m_Bmi.bmiHeader.biXPelsPerMeter = (int)(1000.0F / 0.1f + 0.5F);
      		m_Bmi.bmiHeader.biYPelsPerMeter = (int)(1000.0F / 0.1f + 0.5F);
      		m_Bmi.bmiHeader.biPlanes = 1;
      		m_Bmi.bmiHeader.biSize = 40;
      		m_Bmi.bmiHeader.biSizeImage = Cols*Rows;
      		m_Bmi.bmiHeader.biClrUsed = 256;
      
      		pData = new BYTE[Cols*Rows];
      		memset(pData, 40, Cols*Rows);
      	}
      	~TestImage8bit() {}
      };
      
      
      
      int main()
      {
      TestImage* pIm = new TestImage8bit(50, 50);
          return 0;
      }
      
      
    • Sorry, I clicked "Submit" before the time...
      
      bellow the natvis snippet:
        <Type Name="TestImage">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        </Type>
        
         <Type Name="TestImage">
             
          <Expand>
            <Synthetic Name="[type]">
              <DisplayString>UINT8</DisplayString>
            </Synthetic>
            
            <Item Name="[channels]">m_Bmi.bmiHeader.biBitCount/8</Item>
            <Item Name="[width]">m_Bmi.bmiHeader.biWidth</Item>
            <Item Name="[height]">m_Bmi.bmiHeader.biHeight</Item>
            <Item Name="[data]">pData</Item>
            <Item Name="[stride]">m_Bmi.bmiHeader.biWidth*(m_Bmi.bmiHeader.biBitCount/8)</Item>
          </Expand>
        </Type>
      
      It is working well in VS2013 and does not work in VS 2015
    • Hello. I've found some things about this issue.
      The problem happens with hierarchy of image classes, for example:
      class Image{};//The base class
      class Image8bit : public Image{}; 
      class Image24bit : public Image{};
      class Image32bit : public Image{};
      
      and we are manages pointer of type Image* to hold concrete images.
      If we declare in natvis only Image class, the visualizer shows "Invalid" for Image* pImage pointers. It worked well in VisualStudio 2013.
      
      My temporary workaround is to declare all derived image types in natvis, to add pointer Image* pImage to VS watch window, explicitly cast the pointer to concrete type (in the watch window), than to open the visualizer, and than visualizer shows the image.
      
       
  • make it open source
    2 Posts | Last post April 22, 2016
    • Seeing how more and more MS projects go open source this one should definitely be among them. Especially considering that it is neglected.
    • seconded
  • .bin file format?
    1 Posts | Last post March 24, 2016
    • This is my favorite tool, thank you for making it.
      
      Sometimes I need to dump images to analyze them further. For `double` valued single channeled images I want to dump them into a binary file. But I don't know how `.bin` files are formatted so I can't read them using a 3rd party tool. I couldn't find the format in the documentation. Do you have any idea how can I do this using Image Watch?
  • user type definition "invalid"
    1 Posts | Last post February 16, 2016
    • I ve already defined the user type simple image struct as given in the examples. but i coudln't visualize it, all the time it says "invalid"
      
      I just extend the ImageWatchOpenCV.natvis to visualize my image type. 
      
      
      i see the name of the image type, but invalid
      
      
      <!-- MTCE image MTCE_Img (simple struct to visualize MTCE image structs) -->
         
        <Type Name="MTCE_Img">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        </Type> 
        
        <Type Name="MTCE_Img">
          <Expand>
            <Synthetic Name="[type]">
              <DisplayString>UINT8</DisplayString>
            </Synthetic>
      	  <Synthetic Name="[channels]">
              <DisplayString>YUV</DisplayString>
            </Synthetic>
            <Item Name="[width]">nCols</Item>
            <Item Name="[height]">nRows</Item>
            <Item Name="[data]">imgData</Item>
            <Item Name="[stride]">nCols</Item>
          </Expand>
        </Type>  
      
  • exception has been thrown by the target of an invocation
    4 Posts | Last post January 29, 2016
    • when i start the Image Watch an error throwed "exception has  been thrown by the target of an invocation". 
      I have uncheced Managed C++ Compatibility Mode.
      My vs version is 2013, i have updated with update 1 package .
    • Which process is throwing the exception, your app or Visual Studio?
    • I am getting the same exception as well, thrown by Visual Studio. Every time I click on Image Watch from View > Other Windows, I get this exception.
      
      I have tried:
      - restarting the machine : doesn't solve the problem
      - uninstalling and reinstalling Image Watch : doesn't solve the problem
      - reducing the size of PATH (currently 1035 chars) based on some comments on the web : doesn't solve the problem
      
      At this point, I am not able to start/use Image Watch at all. Some help is greatly appreciated. :)
    • I found the solution was due to some missing Visual C++ redistributable .dlls. Please see my post on StackOverflow : http://stackoverflow.com/questions/35080232/imagewatch-in-visual-studio-2013-exception-has-been-thrown-by-the-target-of-an/35080233#35080233
      
      I hope this helps.
1 - 10 of 100 Items