Scientific Visualization and Computer Graphics

Scientific Visualization and Computer Graphics > BI > FSE > RUG * Print * Search

Chapter 9: Image representation and visualization

Sample programs

Image representation

This sample introduces a simple class for representing 2D image data. Pixel types can be scalar (e.g. luminance values), RGB colors, or other user-defined types. A simple renderer is presented for displaying such images. Additionally, code for reading and writing images from/to PGM and PPM files is given. Try to extend this sample by adding support for other image file formats, or other pixel types!

Image representation sample

Fast Marching Method for distance transforms

This sample demonstrates the use of the Fast Marching Method (FMM) to compute distance transforms of pixel shapes. For illustration, the sample reads a grayscale or color image; next, it creates a binary shape by grayscale thresholding; finally, it computes the distance transform of the boundary of this binary shape. Although the same results can be achieved by faster methods (see samples below), the code can be easily adapted to learn the FMM and use it for other applications. Try to compute distance transforms from binary thresholdings of your own images!

Fast Marching Method

Image-based Distance Transforms

Given a 2D point cloud, this sample computes a pixel-accurate Euclidean distance transform (DT). This implementation uses a splatting-based approach with OpenGL fragment shaders, which is very simple and fast. Faster DT methods are given further below. The image below shows a luminance-coded DT for the boundary of a binary shape.

Image-based Distance Transforms

Skeleton computation with the AFMM

This sample demonstrates the Augmented Fast Marching Method (AFMM). The AFMM extends the FMM to compute distance transforms, feature transforms, and multiscale skeletons of binary shapes. The sample creates such shapes by thresholding grayscale or color input images, and next allows one to compute and visualize the progressively simplified skeleton. Try this on your own grayscale or binary images!

Augmented Fast Marching Method

2D Distance transforms and skeletons in CUDA

This sample shows how to compute distance transforms (DTs) and skeletons of 2D shapes in real-time using a CUDA-based implementations. The original DT algorithm is from Cao et al. (Proc. I3D 2010). This sample extends this algorithm to compute multiscale skeletons and skeleton end-points using the boundary-collapse metric described for the Fast Marching Method demo above.

CUDA skeletons and distance transforms

DT code and method from Cao et al.

Detailed description of the sample code.

3D distance transforms, feature transforms, and skeletons

This sample shows how to compute distance transforms, feature transforms, and surface skeletons of 3D shapes represented as binary voxel volumes. The sample is based on the methods of Meijster et al. (for distance transforms) and the integer medial axis method of Hesselink et al. (for feature transforms and skeletons). It has a very simple CPU-only implementation. ParaView scenarios are included to visualize the results. Try this sample with other 3D shapes of your own! Also, try to modify this sample to visualize the results using the voxel surface sample and/or the volume raycasting sample in Chapter10.

'Note:' For an easy start, set the parameter gamma required by the program to zero.

Integer medial axis sample

3D distance transforms on the GPU

3D PBA code

3D multiscale curve and surface skeletons

This sample demonstrates the method of Reniers et al. for computing 3D multiscale surface and curve skeletons. The sample comes as a full-fledged application allowing one to compute and visualize such skeletons on a variety of 3D voxel shapes.

Multiscale 3D skeletons

3D surface Hamilton-Jacobi skeletons

HJ code

3D curve skeletons (mesh collapse)

This sample computes a 3D curve skeleton from an input shape provided as a PLY mesh file. The sample implements the mesh-collapse technique of Au et al. (ACM SIGGRAPH 2008), described in more detail here.

Mesh collapse skeletonization sample code (cached locally)

Mesh collapse skeletonization sample code (external link)

3D curve skeletons (mean curvature flow)

This sample computed curve skeletons of 3D shapes represented as meshes, using the mean curvature skeleton method of Tagliasacchi et al.. Both source code and precompiled binaries for Windows and OS X are provided. While the method is a bit slower than the mesh-collapse method of Au et al. (see previous sample), it creates curve skeletons of much higher accuracy.

Mean curvature skeletons (external link)

3D curve skeletons (Laplacian contraction)

This sample computes 3D curve skeletons from 3D shapes represented as polygon meshes or point clouds using the Laplacian-basec contraction method of Cao et al. Full source code is provided. While the computed skeletons are less smooth and accurate than those provided by other methods, this technique can work with 3D shapes provided as unstructured point clouds (no connectivity information is required).

Laplacian-contraction skeletons (external link)

Back to the overview