Debug image processing code

What debugging is available for C ++ image processing / computer vision / computer graphics applications? What do you use to track errors / partial results of your method?

What I have found so far is just one tool for online and one for offline debugging:

  • bmd : joins the running process and allows you to view the memory block as an image
  • imdebug : enables printf-style debugging

Both are pretty outdated and not quite what I expect.

What may seem useful for offline debugging will be some style of image logging, say, a set of commands that will allow you to write images together with text (possibly in HTML form, perhaps hierarchical), it’s easy to disable both compilation and runtime, and the least intrusive that she can get.

The result may look like this (exiting our simple tool):
http://tsh.plankton.tk/htmldebug/d8egf100-RF-SVM-RBF_AC-LINEAR_DB.html

Do you know about any code that goes in this direction?

I would be grateful for any tips.

+8
c ++ debugging logging image-processing computer-vision
source share
4 answers

Based on the perspective of ray tracing, perhaps some of these visual methods are also useful to you (this is one of my plans to write a short article about such methods):

  • Superficial normal visualization. Helps find surface gaps. (no image, the appearance is very similar to ordinary cards)

    color <- rgb (normal.x+0.5, normal.y+0.5, normal.z+0.5)

  • Remote visualization. Helps to find surface gaps and errors in finding the nearest point. (image taken from an abandoned ray indicator)

    color <- (intersection.z-min)/range, ...

    enter image description here

  • Limit visualization of volumetric movement. Helps visualize the hierarchy of bounding volumes or other hierarchical structures and helps to see crawl access points, such as a code profiler (for example, Kd trees). (tbp http://ompf.org/forum coined the term Kd-vision).

    enter image description hereenter image description here

    color <- number_of_traversal_steps / f

  • Visualization of the Bounding Box (image from picogen or so, a few years ago). Helps verify the break.

    enter image description here

    color <- const

  • Stereo. It may be useful in your case as a real stereographic view. I must admit, I never used this for debugging, but when I think about it, it can be really useful when introducing new types of 3d primitives and -trees (image from gladius, which was an attempt to unify in real time and non-realtime ray trace)

    enter image description here

    You simply visualize two images with a slightly shifted position, focusing on some point

  • Hit-or-not visualization. May help find epsilon errors. (image taken from metatrace)

    http://th01.deviantart.net/fs70/PRE/f/2010/309/b/0/debugging_a_c___in_s_anity_by_phresnel-d327c6w.png

    if (hit) color = const_a; else color = const_b

  • Some hybrids of several methods.

    • Linear interpolation: lerp(debug_a, debug_b)
    • Alternation: if(y%2==0) debug_a else debug_b
    • Any combination of ideas, such as the color tone from Bounding Box Visualization, but using the actual intersection of the scene and the lighting.

You can find a few more crashes and debugging images at http://phresnel.org , http://phresnel.deviantart.com , http://picogen.deviantart.com , and possibly http: //greenhybrid.deviantart. com (old account).

+3
source share

As a rule, I prefer to unload bytearray of the processed image as raw data triplets and run Imagemagick to create png from it with a number, for example img01.png. That way, I can easily trace the algorithms. Imagemagick is launched from a function in the program using a system call. This makes it possible to debug without using any external libraries for image formats.

Another option if you use Qt is to work with QImage and use img.save ("img01.png") from time to time, as printf is used for debugging.

+1
source share

it is a little primitive compared to what you are looking for, but I did what you suggested in your OP using standard logging and by writing image files. As a rule, the processes of recording and processing logs and signals exist in unit tests.

Signals

identifiers are given (file names are often entered) that can be supplemented (often this is the name of the process or step).

for the development of processors, it is very convenient.

Adding html to posts will be simple. in this context, you could easily create visible html output - you would not need to generate any html, just use the html template files and then paste the messages.

I would do it myself (as I have done many times for several types of signals) if you do not have good referrals.

0
source share

In Qt Creator, you can view image modifications by executing code in a regular C ++ debugger, see, for example, http://labs.qt.nokia.com/2010/04/22/peek-and-poke-vol-3 /

0
source share

All Articles