How to save images during debugging the code in opencv? - opencv

Im working on reducing noise from noisy image in OPENCV using different filters. i want to know that how i capture or save the result images during debugging code?

You can:
Save with imwrite all your debugging images, better in a specific folder.
Use Image Watch which will enable you to see all your Mat in a nice and powerful viewer during debugging. Just download and install it. You can access the Image Watch viewer in VS: View -> Other Windows -> Image Watch
I recommend the second approach, which personally I find very useful.
Have a look also at this answer.

If you can use CLion instead Visual Studio you can utilize the OpenCV Image Viewer plugin, which displays matrices while debugging with just one click. There is also an option to save the image on a disk.
https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer
Disclaimer: I'm the author of this plugin

Related

image watch in opencv debug

Dears,
I use visual code editor for opencv app development, I wonder if there is some extension similar to Image Watch for OpenCV available. it can be handy for development.
If you are using gdb for debugging, take a look at OpenImageDebugger
I am using this on Linux and it works pretty good.
If you can use CLion instead of Visual Studio Code you can utilize the OpenCV Image Viewer plugin, which displays matrices while debugging just on click.
https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer
Disclaimer: I'm an author of this plugin

How to change Opencv image viewer?

I have installed OpenCV on my desktop and laptop which they have Ubuntu 14, and i have some problem with its image viewer.
First of all when i type :
./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_eye.xml" --scale=1.5 [address of my image]
It shows my image with its image viewer , but it isn't resizabe on my desktop and it don't show control buttons at top of it on my laptop.
How can i fix these problem or can i change its image viewer ?
Opencv uses in many demo applications its own GUI (highgui), its features are limited and are platform-dependent. For example, I think that the "auto-zoom" feature that enables you to see the pixel values is available only on Windows. And, although recent versions added some Qt support to add somes features (buttons,...), the app has to be build to enable these features, and this is probably not the case in your example.
However, you can always edit the code of these apps (here, the facedetect app) so that it just saves the images on disk, instead of showing them on screen. Then rebuild. Or add yourself the buttons you want, see the manual.

clear canvas dicom image viewer

Anybody know what is the base component used for viewing a DICOM image in the Clear Canvas image viewer?
Let me add more info.,
Please refer to http://www.clearcanvas.ca/dnn/
Its a good DICOM Image Viewer, I think they used a user control.
I believe it is a control that they built. Look at their Application Framework (as opposed to their DICOM framework). There is a section on their forum dedicated to the App Framework

How to translate ImageMagick commands into ImageMagick API calls?

I need to do some light image processing on large image, and I try to use ImageMagick for that. Unfortunately, the API documentation has a very low information content, with documentation similar to:
MagickDeleteImageArtifact
MagickDeleteImageArtifact() deletes a wand artifact.
The format of the MagickDeleteImageArtifact method is:
MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand, const char *artifact)
A description of each parameter follows:
image
the image.
artifact
the image artifact.
Could anybody suggest a few information sources for ImageMagick that would have, you know, information?
(and yes, this piece of "documentation" is pasted from ImageMagick web site, with the incorrect parameter)
Edit: Here is the context: I develop an iOS application, so I want to call ImageMagick from the C language (or Objective-C or C++). The need is to split large images that would not fit in the limited amount of RAM of an iOS device into smaller "tiles" (and downsample for lower resolution versions too. But once I have the tiles, I can do that using only iOS facilities).
Edit 2: Using the command line, I can achieve this tiling with the "convert" command with corresponding parameters. So my immediate need would be to translate such a command line command into the relevant set of API calls.

Using ImageMagick from Command line in .Net?

I am using ImageMagick from Commandline in .Net? Although a .Net wrapper (ImageMagick.Net in codeplex) is available but it is still in alpha and does not have implementation for all the command line options e.g Distort, Montage. Therefore I am using System.Diagnostics.Process class to invoke the ImageMagick command line.
What are the Pros/Con of this approach? I can see a performance issue if I have to perform multiple transformation on the same image and if I invoke the command twice then the commandline will load the Image twice. Is there a way I can chain the commands so that output of the first transformation is feed into the second command?
It will definitely be slower, and when you chain commands, you are going to be encoding and decoding the image into a format unnecessarily -- if you do this, make sure you use a lossless format like PNG for intermediate formats. To speed it up, use one without compression.
Two other choices
Use ImageMagick.NET and then wrap anything else you need from imagemagick yourself, probably by contributing to the project
My company, Atalasoft, has a free .NET imaging SDK with a lot of overlap with ImageMagick. You can download here: http://atalasoft.com/photofree -- Montage is basically the same as our Overlay commands and Distort is a 2D transformation, which are all included. If ImageMagick.NET can accept and produce .NET Bitmap objects, then you can use both together fairly easily.

Resources