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!
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.
I was debugging an opencl related routine when, suddenly, all of my Mat's became [invalid] on the Image Watch -- it simply stopped woring. It turns out I had a float variable named cv, and after renaming it to something else, the Image Watch started working again.
could you give me a code snippet to explain, how to use and where to place an operator? I would like to use @mem operator to display image from memory:
RawImage(const unsigned char* data, int size, int width, int
unsigned char* data;
I tried this .natvis (snippet):
however, this is evaluated as "invalid image".
Thanks a lot!
I would expect "Zoom to Original Size" would show the image on the screen pixel perfectly, but I found that's not always the case which can be misleading.
An example: I'm viewing a 11x16 image in "original size":
Zoomed in version: http://i.imgur.com/z5QfX4T.png
If you look closely, you can see there are some grey (not purely black or white) pixels. On the original image, there are only black and white pixels, see:
Also note, that the "Original size" image is 12x18 which is clearly not really the original size, but a slightly resized size of the image.
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.
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(https://msdn.microsoft.com/en-us/library/zf0e8s14.aspx)
Let me know if that helps.
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?
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?
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]@live.com.
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.
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.
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
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").
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.