MRaster examples 22.0.0.0
Image Processing Library
Loading...
Searching...
No Matches
demo_data_image.cpp File Reference

Demonstrate "data images" and mjr::ramCanvasPixelFilter. More...

Go to the source code of this file.

Detailed Description

Demonstrate "data images" and mjr::ramCanvasPixelFilter.

Author
Mitch Richling https://www.mitchr.me
Standards
C++20
Details

One of the most powerful abstractions in modern image processing is to think of an image as a sample drawn from a real function of two variables taken on a regular grid. This simple change of perspective opens up an entire world of mathematical techniques which may now be applied to image processing problems. In science and engineering visualization we are presented with the situation in reverse. That is to say we have one or more two dimensional grids of data (frequently thought of as values sampled from some underlying function), and we wish to visualize this data by synthesizing a pseudo-color image.

For example, consider the visualizing temperature variation across Kansas – which, in the grand tradition of Physics, we will assume to be a 2D rectangle. In this case the data consists of temperatures measured on a regular grid across the state. In these contexts we frequently store the "data" in something like HDF5, and then synthesize the visualization into a "image" manged by something like libPNG. Because MRaster supports such a broad array of data types for colors and color components, we can use MRaster images both for visual images and to house data instead. People doing multi-spectral imaging are one of MRaster's largest user communities.

Another large MRaster community are people visualizing fractals, ODEs, and chaotic systems. For this community the underlying function is known, and can be computed (sometimes at great cost). For this group, the data image serves as samples of this underlying function. Many of the MRaster example programs follow this paradigm:

  • demo_data_and_filter.cpp: We use an integer image to hold values of the Mandelbrot escape time function.
  • doublePendulumM.cpp: We use four floating point images to store the state of a differential equation solution
  • sic.cpp & peterdejong.cpp: We use integer images to store a 2D histogram

Definition in file demo_data_image.cpp.