Image Watch

Microsoft Free

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

Microsoft
(23) Review
Visual Studio
2013, 2012
Download (15,960)
3/17/2014
1.5.1103.0
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (23)
Q and A (51)
Sign in to write a review
Sort by:

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 Supe_Leva | 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

by Brian Catlin | August 11 2013

This awesome tool makes developing OpenCV programs a breeze!

by stocastico | August 07 2013

Excellent tool, highly recommended

by Mahesh.Nalam | July 17 2013

This is Very useful tool

by Eric Stollnitz | July 08 2013

This is an excellent tool for viewing images while debugging. Saved me tons of time!

by The Great Fox | June 21 2013

It's an awesome tool for debugging.

You should add Zoom In/Out and Pan though - it would really help when debugging large Font texture-atlases. You want to be able to zoom in the 128x512 bitmap and see how it looks.

Great work! :)

by knauer0x | June 21 2013

Nice tool!

by Arkady Shapkin | June 18 2013

by primfaktor | June 18 2013

This makes debugging IPCV so much easier. Great tool!

by MikeRanzinger | June 14 2013

I have been needing a tool like this at work for forever! I also love the extensibility of it, so that you can make it work for your own types.

by Fırat Esmer | May 18 2013

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


  • diagnostics
    5 Posts | Last post Thu 7:04 PM
    • Is it possible to have error diagnostics? Either in the watch window itself or in the debug output together with the other natvis messages.
      It's really hard to tell why it doesn't display the image based on "[invalid]".
    • Hi Trass3r, thanks for the feedback. We've noticed that, too, and it's on our list. 
      
      In the meantime, I find it easiest to debug a natvis in two steps:
      
      First, disregard Image Watch and just look at the built-in Locals/Autos/Watch window. If you don't see your natvis items there ("[width]", for example), you have a bug in your natvis. That bug is unrelated to Image Watch and can be investigated using Visual Studio's built-in natvis diagnostics. 
      
      Then, once the natvis is working, it should be fairly straightforward to see why Image Watch shows "[invalid]".
      
      Hope that helps. Good luck! -Wolf
      
    • Everything is fine. And a manual '@mem(img.m_storage.m_data,FLOAT32,1,16,16,64)' works.
      
      <Item Name="[channels]">1</Item>
      <Item Name="[width]">m_storage.m_cols</Item>
      <Item Name="[height]">m_storage.m_rows</Item>
      <Item Name="[data]">m_storage.m_data</Item>
      <Item Name="[stride]">m_storage.m_cols * sizeof($T1)</Item>
      
      [type]	FLOAT32	
      [channels]	1	int
      [width]	16	unsigned __int64
      [height]	16	unsigned __int64
      [data]	0x000000000030d960	void *
      [stride]	64	unsigned __int64
      
      I also tried various casts cause I think a had a problem with the types before.
      But nothing happens.
    • Any ideas?
    • Hey Trass3r--sorry for the delay. Are debugging in mixed-mode? Also, would you mind providing a repro (C++ type definition + natvis)? Thanks!
  • Dump file formats
    2 Posts | Last post April 03, 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.
      
      
      Regards,
      
      Joris
    • 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.
      
      Thanks!
      
      -Wolf
  • Can I use vs2013?
    3 Posts | Last post March 31, 2014
    • Can I use vs2013? 
      I am using vs2013 to "[invalid]" has been output.
      Below is a sample code.
      
      struct My8BitRGBImage
      {
      	unsigned int ncols;
      	unsigned int nrows;
      	unsigned char* data;
      };
      
      
        <Type Name="My8BitRGBImage">
          <UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
        </Type>
       
        <Type Name="My8BitRGBImage">
          <Expand>
            <Synthetic Name="[type]">
              <DisplayString>UINT8</DisplayString>
            </Synthetic>
            <Synthetic Name="[channels]">
              <DisplayString>RGB</DisplayString>
            </Synthetic>
            <Item Name="[width]">ncols</Item>
            <Item Name="[height]">nrows</Item>
            <Item Name="[data]">data</Item>
            <Item Name="[stride]">ncols*3</Item>
          </Expand>
        </Type>  
    • and i am unchecked Use Managed Compatibility Mode in debug option
    • ye.. Solved
  • Function evaluation
    2 Posts | Last post March 25, 2014
    • First of all, thank you for this great tool. In particular, I appreciate the possibility to type in a function, which returns an image which is in turn displayed in the visualizer. I use it to display plots, histograms, etc during debug. I believe there is a great potential to make this feature even more powerful. Eg allow: Mat function1(function2(...)) calls. This would bring the debugging experience even closer to Python/Matlab-like scripting. 
    • Hi Zdenek, thanks very much for your feedback! 
      
      The feature you suggested would be very useful indeed. We have been thinking about similar functionality in the context of visualizing "1-d" images, i.e. those that have only one row or column (including non-image sequence containers like std::vector<char>, for example). I think the main difficulty there is making the logic for scaling axes and binning (for histograms) robust, so that it works well with all kinds of weird data distributions, NaNs, very long and short vectors, etc. But it's definitely on our to-do list.
      
      Best, -Wolf 
  • Can not see any images in Image Watch
    2 Posts | Last post March 05, 2014
    • Hi,
      I have created an MFC application using OpenCV. Currently is very basic,
      just load an image or a video and playback the video.
      In both cases though, I can not see any image appearing in the Image Watch.
      In the built in Locals view I can see the cv::Mat structure and all its members. 
      Any suggestions? 
      I am using Visual Studio 2012 update 4. 
      
    • Sorry, remove my comment. Stupidity is infinite. I just had to press the magnifying icon on the local view fro the image to appear in the image watch.  
  • Column-major storage format?
    2 Posts | Last post February 26, 2014
    • This extension doesn't seem to support column-major storage. If not, could that be added? Or/And, a transpose operation? (@trans)
    • Hi V.N.V, thanks for your feedback! This is a great suggestion. We may be able to integrate this feature with our next update (which is hopefully coming soon.. :). -Wolf
  • Handling of NaNs in float images
    3 Posts | Last post February 12, 2014
    • Hi, I am using non-signalling NaNs to represent 'no pixel' in floating point images but it is producing inconsistent results when Auto-Maximize contrast is used. Sometimes it forces the image to be wholly black, sometimes it 'just works' as expected.  How are they handled and could they be ignored for the purposes of maximizing the contrast?  A way of specifying the 'valid' value range would be a way round this also I'd imagine.
      
      Thanks for a great add-on, it's proving indispensable. :)
    • Hi Gasp0de, great catch! Many thanks for reporting the issue. We'll fix that in the next update (might take a few weeks--I'm still wrapping up several other projects at this time). Best wishes, -Wolf
    • Cool, thanks.  I expect similar problems occur with +-INF, DNF, and other special values.  I don't expect it's worth it right now but there might be some value in visualising these special pixel states in the image preview (perhaps symbols on the pixels once zoomed in enough :)
  • VS 2012 Express
    2 Posts | Last post February 10, 2014
    • Does it works with VS 2012 Express? I have tried to install it but it says: "This extension is not installable on any currently installed products". How should I do it? Please help
    • Hi Anonim19, I'm sorry but the Express versions of VS do not support extensions: http://stackoverflow.com/questions/13266694/adding-extensions-in-visual-studio-express-2012-for-window8-desktop 
  • multiple images out of a single type?
    4 Posts | Last post January 16, 2014
    • Say I have a structure with 1 RGB data array (pointer) and 1 corresponding single-band array with a lower resolution.
      Is there a way to view both images?
    • So my general question is how to support several images residing in a single structure.
    • I'm afraid your scenario is not supported in the current version. 
      
      We do support planar images, though, which means you can visualize a list of images inside one data structure as one image with different channels. However, all planes must have the same resolution and pixel format. One reason for this limitation is that it is not straightforward to display a collection of arbitrary-sized images (you could make some sort of collage, I guess, but it's tricky to get that right all the time). 
      
      The supported YUV video formats are exceptions to this rule. That's because their resolution ratios are known and simple (2x, 4x), and so we can resize the lower resolution planes and visualize everything a single image. 
      
      Back to your problem: are you referring to RGB-D images by any change? I think RGB-D is becoming quite common nowadays and we should be able to support it as a specialized format in ImageWatch (like the YUV formats).
    • Unfortunately I don't remember which structure it was cause some time has passed. But I think it wasn't RGBD.
  • All images are [Invalid]
    5 Posts | Last post January 14, 2014
    • This looks very useful. However, the viewer always shows [invalid] where the image would be disaplyed, and in the two lines next to the thumbnail. 
      
      I'm using OpenCV 2.4.2 and 2.4.6
      VS2012 Update 3.
      
      Thanks for any suggestions.
      
      Mitch
      
    • Additonal info after reading conversation with Mills back on Aug 2.
      
      The app is a C#. We have another project that that supports C++/CLI. It is in the C++/CLI project that we create the Mat objects and use the openCV methods.
      
      I'm beginning to think that even though I have mixed mode debugging disabled, and have enabled native code debugging in the app, Image Watch will not display an image if the Mat objects are in a C++/CLI project.
    • Hi Mitch,
      
      The good news is that Image Watch does support C++/CLI. However, since it builds on Visual Studio's natvis (NATive VISualizer) mechanism, you need to make sure that that works. This should never be an issue with purely native projects, but mixed mode projects require that you get a few settings right.
      
      First, you can tell that natvis works if Visual Studio's built-in Locals window expands cv::Mat variables to something like "[width]" "[height]" etc., instead of the raw class members ("data", "step", etc). 
      
      If natvis doesn't work with your current setup, make sure to
      
      1) Attach a purely native debugger, not a mixed one. Note that "enabling native code debugging" in the C# project properties means "managed + native = mixed", not "native only". So you may have to attach to the running process via Debug->Attach, instead of the more convenient "Debug->Start Debugging"). 
      
      2) Turn off Tools->Options->Debugging->Managed C++ Compatibility Mode
      
      3) Put "#pragma unmanaged" guards before any of your OpenCV code. This will ensure that your OpenCV code is actually native, not managed.
      
      Let me know if that helps.
      
      Best,
      -Wolf
    • Hi Wolf,
      
      Never got it working with your suggestions a few months ago. I just updated to VS2013 so I thought I'd give it a try, since this would be really useful. Here's where I'm at now:
      
      > expands cv::Mat variables to something like "[width]" "[height]" etc., 
      > instead of the raw class members ("data", "step", etc). 
      
      VS does expand the Mat class to about 20 members including cols and rows as well as step and size. So I assume natvis is working. 
      
      > So you may have to attach to the running process via 
      > Debug->Attach, 
      
      I manually attached to my app with only the "native" debugger selected.  Unfortunately, now I can't even set a break point. VS tells me that "No executable code of the debugger's target code type is associated with this line"
      
      > Put "#pragma unmanaged" guards before any of your OpenCV code.
      The compiler complains that #pragma unmanaged cannot be used because it is a managed class (C++/CLI)
      
      Is there something else that I am missing?
      
      Thanks,
      
      Mitch
      
      
    • Hi Mitch,
      
      sorry for the trouble :/ 
      
      What you're experiencing sounds like a known Visual Studio quirk around mixed mode debugging and natvis visualizers. Here's some more information on that topic: http://social.msdn.microsoft.com/Forums/vstudio/en-US/fdbc4e51-f3f3-40bd-8fd5-369e1594ec74/debug-visualizer-support-in-mixedmode-apps-has-regressed-in-vs-2012
      
      In your particular case, please note that natvis is *not* working if VS expands cv::Mat into the ~20 members including cols, rows, etc. If it *is* working, you will see [width], [height], etc. instead. I assume that when you attach the native-only debugger to your running app (as opposed to launching under the mixed mode debugger), natvis starts working?
      
      The other phenomenon you're seeing is that VS cannot set breakpoints on your C++/CLI code. That's because even though that code looks like C++, it is compiled to managed (not native) code, and the native-only debugger doesn't understand that. You can, however, force the compiler to produce native code with the #pragma unmanaged directive. I believe the reason why that didn't work for you is that somewhere after your unmanaged #pragma there is code which is inherently managed, e.g. a managed class definition, or any code that uses managed references ("^")?
      
      Here is my suggestion. Move all OpenCV code either to the end of the .cpp file, or better yet, to a different .cpp file or library altogether, which is compiled as native C++ only (no CLR). Use as small an interface as possible to call the native code from managed. This will not only enable ImageWatch (or natvis in general, e.g. for std::vector), but it may increase the performance of your app because it minimizes managed/unmanaged transitions at run-time. 
      
      Hope that helps!
      
      Best,
      -Wolf
1 - 10 of 51 Items