Hiho,
When I step through my code while having Image Watch enabled, as soon as I hit a cv::imread(someFile), imagewatch shortly displays the image (correct resolution/type), but Visual Studio instantly crashes ("... has stopped working..."). Some of the details it shows:
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 11.0.60315.1
Application Timestamp: 5142bb7b
Fault Module Name: StackHash_1e26
I tried reinstalling Image Watch, that did not help.
Any ideas? I'd love to be able to use Image Watch.
Thanks!
Dear Wolf,
Yeah you're actually right, that's correct! As long as I don't open the "Autos" variable window, it seems to work and doesn't crash.
Why is that? Is it a bug currently and you knew about it?
Yes, this is a known Visual Studio issue. It happens when the "Autos" window wants to display a function return value that has a "UIVisualizer" registered (the little magnifying glass icon). The Visual Studio team is aware of this, but I don't know their schedule for the fix. For now, the best solution is to hide the "Autos" window in these scenarios :)
Oh ok, I actually read about that bug with the "UIVisualizer", but as I never heard that term before, I didn't think it was associated with anything I was doing so I thought it's totally unrelated. Maybe describing that more clearly would help other people fall for this :-)
Actually I never even clicked on those glass icons before - thanks, you never stop learning :-)
I have problem with installation. I have Visual Studio 2012 Express for Windows Desktop, but when I try to instal Image Watch I get this notification message:
"This extension is not installable on any currently installed products."
I had make a visualizer for OpenNI2.
http://sdrv.ms/112lQkZ
It can display the image from dpeth and color stream.
By the way, is it possible to visualize a volumetric data(3D image, or slices of images)?
I hope that I can show a slice of the volume. Is there anyway to do this?
Hi KHeresy--thanks for sharing your OpenNI visualizer. We don't support volumes, unfortunately. But you can display a slice of the volume by doing some pointer arithmetic in the natvis. For example, to visualize the center slice of a 'width' x 'height' x 'depth' volume starting at 'baseAdr', you could write: <Item Name="[data]">baseAdr + pixelSize*width*height*(depth/2)</Item>
If your volume is single-channel, you can interpret it as an image with many channels (depth = number of channels) and use the @band() operator to look at any single slice. For example, @band(volume, 29) will display the 29th slice. Note, though, that Image Watch doesn't support more than 512 channels. Also, the entire volume will be copied over to Visual Studio each time you hit a single-step or break point, which could be slow if the volume is large.
"Auto Maximize Contrast" is quite good. However, some programs allocates the memory for 8bits pixel with int16 for the convenient calculation. However real data is just 8 bits range, 0~255. In this case I cannot see the image due to the original type's range in Image Watch. Of course "Auto Maximize contrast" can resolve the this problem. However it is similar to histogram matching. I just want to see real pixel image according to bit depth. So I want to propose to make another menu for the image display according to the real bit depth.
I want to separate "display depth" from input memory.
Even if I use int16 or uint16 for the 8 bits raw image file, I want to display the image well as if I allocated the memory with uint8.
Hi HyunHoJo, thanks a lot for your feedback! Your proposal sounds good. I'll think about it. In the meantime, note that there is the "@norm8" operator, which converts the image to 32bit float and scales all pixel values by 1/255. For the type of image you're describing (8bit values in 16bit pixels) this should do the trick: it will produce a float image with values in [0;1], which is the default display range for float pixels.
First I appreciate your add-in for VS 2012.
It is very useful for me to develop video codec.
Image operation such as "@band" is also useful to extract one component.
Would you mind if I ask you to make a new operation, "@clip" ?
Because sometimes the memory is not initialized with 0. In that case, Auto maximize contrast cannot run well due to the garbage pixel values.
Is there a reason why typed OpenCV cv::Mats are not supported, i.e., any instance of cv::Mat_<>? Also, it would be nice to be able to see all the values of the cv::Mat::data member in the debugger, not just the first one. Using autoexp.dat syntax it was possible to display the values using the the implementation at https://bitbucket.org/sergiu/opencv-visualizers/src/tip/autoexp.dat#cl-90. Unfortunately, this doesn't work anymore when using the natvis syntax.
Hi Sergiu--for cv::Mat_<> support, please see the "Template OpenCV types" thread below. Regarding the data member, note that you always have the [Raw View] where you can look at the raw data members. You could also extend ImageWatch's .natvis definitions with your own expansions to visualize additional data members. To what extent you'll be able to reproduce your autoexp.dat view, I'm not sure. I'd be surprised, though, if the newer natvis technology was inferior to the older autoexp.dat.
Hi Wolf,
thanks for the answer. When looking at the Raw View, you can also see the first element of cv::Mat::data only. Using natvis syntax, one has to use ArrayItems to be able to view all data elements. And this is what causes problems.
Consider the following visualizer for cv::Mat's data member which uses ValuePointer Condition to differentiate between 8UC3 and 8SC3 types:
<ArrayItems>
<Rank>dims</Rank>
<Size>($i == 1) * rows + ($i == 0) * cols</Size>
<LowerBound>($i % rows) * (step.p[0] / step.p[1]) + ($i / rows)</LowerBound>
<!-- 8UC3 -->
<ValuePointer Condition="(((flags & (511 << 3)) >> 3) + 1) == 3 && (flags & 7) == 0">(cv::Vec<unsigned char,3>*)data</ValuePointer>
<!-- 8SC3 -->
<ValuePointer Condition="(((flags & (511 << 3)) >> 3) + 1) == 3 && (flags & 7) == 1">(cv::Vec<char,3>*)data</ValuePointer>
</ArrayItems>
This causes the debugger to display {...} in the preview and the raw view only when expanded. If the second ValuePointer is removed, it works. I've tested this both with Visual Studio 2012 update 1 and 2.
Hi Sergiu--I'm afraid I'm not enough of a natvis expert to give you a good answer to this question. I would try the Q&A forum at http://code.msdn.microsoft.com/windowsdesktop/Writing-type-visualizers-2eae77a2.
Hi
First off excellent extension this is the one thing that I have really been missing when porting algorithms prototyped in matlab, so top marks there it makes interrogating the what how in the code so much easier!
However... I was wondering if you had any experience with custom natvis files causing the debugger to not let go of the pdb and so be unable to rebuild after debugging once? I would really appreciate any suggestions for a fix/work around, as my current solutions of a) don't use custom natvis, and b) restart VS2012 every rebuild are somewhat suboptimal...
Keep up the amazing work this plug in is the best! (or at least on a par with vsvim :P )
Thanks, Geoff! The pdb locking you're seeing is a known issue in VS2012. It has been fixed in VS2012 Update 2 (download link: http://go.microsoft.com/fwlink/?LinkId=273878).
Cheers Wolf, feeling a little sheepish sorry I should have checked if there was a patched update before asking. Anyway installed now and running smoothly. This extension is so much fun!
Hi
i'm a developer of Multimedia applications, and i really like this extension. i was also wondering if there is some plans (or existing solutions) to debug audio data (possibility to see the waveform). Something more generic would be to be able to plot a 1 dimensional array as a a curve.
also for streaming application, would it be had to have a watch set on a stream that records it over the time in a buffer on which I could apply the same view ?
I know I'm asking a lot, and perhaps it already exists,
Thank you for your great work.
Best
Thanks for your feedback, Adrien! Your suggestion makes perfect sense. We do have an internal implementation that does that (see the "Custom decompression routines" thread in this forum). Unfortunately, it is still too early to say if or when we can make this functionality public.
Hello
I've written a natviz file for the Intel Performance Primitive sample class (UMC::VideoData.) It there a way to submit more vizualizer file for inclusion ?
It would be great if Image Watch could also handle planar format, including subsampling, like YUV 4:2:0 or 4:1:1 for video frame, etc.
Very nice tool !
Pascal Binggeli
Hi Pascal, thanks for your comments! The IPP visualizer looks great. We're working on supporting more formats (including planar, but not sure if subsampled), that should make it even more complete. Right now we don't have a process for submitting visualizers other than this forum. If there's enough interest in the community, though, we can set up a dedicated website for sharing visualizers. So please keep them coming! :)
Hi,
When I try installing the tool on MSVC2010 (V 10.0.30219.1 RTMRel), by doucle-clicking on "ImageWatch.vsix", I get the following message: "The extension manifest is invalid".
Can you help me solving this issue?
Thanks
Emmanuel
It seems I've seen somewhere it was supported by MSVC2010 but actually now when I check in this website, I see only MSVC2012. This must be my problem. Any possibility of a version for MSVC2010?