Distance Transformation

This function block is designed to transform a grayscale image into a continuous distance value representation, where each pixel's value represents its distance to the nearest black pixel.

πŸ“₯ Inputs

Image Gray A grayscale image that will be transformed using different distance transformation algorithms.

πŸ“€ Outputs

Image Gray The output is a grayscale image representing the distance transformed image.

πŸ•ΉοΈ Controls

Transformation Type A dropdown menu that allows users to select the type of distance transformation to apply. Options include:

  • DIST_L2 - Euclidean distance.

  • DIST_L1 - Manhattan distance.

  • DIST_C - Chebyshev distance.

🎨 Features

Flexible Distance Metrics Users can choose from various transformation types to suit their specific needs.

Normalized Output The output images are normalized to enhance the visual representation of distances.

πŸ“ Usage Instructions

  1. Input Grayscale Image: Connect a grayscale image to the Image Gray input.

  2. Select Transformation Type: Choose the desired distance transformation type from the Transformation Type dropdown.

  3. Evaluate: Run the block to obtain the distance transformed image.

πŸ“Š Evaluation

When executed, this function block processes the input image and generates an output image that visually represents the distance from white pixels to the nearest black pixel.

πŸ’‘ Tips and Tricks

Image Preparation

It's recommended to use Image Threshold before this function block to define clear distinctions between foreground and background pixels.

Distance Transformation Type Selection

Experiment with different distance transformation types to determine which yields the best results for your specific image processing task.

πŸ› οΈ Troubleshooting

No Output Image

If the output image is not as expected, verify that the input image is indeed grayscale. Ensure that you are providing a valid image to the function block.

Unexpected Distance Values

If the distance values seem off, check the input image for any noise or artifacts that could be affecting the distance transformation. Preprocessing steps such as Denoising may help improve the output.

Last updated