Contrast Optimization

This function block enhances local contrast of images using a contrast-limited adaptive histogram equalization technique. It is useful when details are hidden in regions with similar brightness and you want to make those details more visible without over-amplifying noise.

πŸ“₯ Inputs

Image Any The input image to be contrast-enhanced. Works with color or grayscale images.

πŸ“€ Outputs

Image Any The contrast-enhanced output image.

πŸ•ΉοΈ Controls

Grid Size Adjusts the size of the local grid used for contrast equalization. Larger values create larger tiles and coarser local contrast adjustments.

Clip Limit Controls how strongly contrast is limited to avoid over-amplifying noise. Higher values increase the amount of contrast enhancement.

🎨 Features

  • Enhances local details in shadows and highlights while preventing strong noise amplification.

  • Works on color images by applying enhancement to the lightness channel and preserving color.

  • Interactive sliders let you tune the block in real time for your scene.

πŸ“ Usage Instructions

  1. Connect an image source into Image Any.

  2. Adjust the Grid Size to control the scale of local contrast patches.

  3. Adjust the Clip Limit to control the strength of enhancement.

  4. Observe the result from the Image Any output and fine-tune sliders as needed.

πŸ“Š Evaluation

When executed, this function block processes the incoming image and produces an enhanced image that reveals local contrast differences while keeping noise under control.

πŸ’‘ Tips and Tricks

  • For very large images, use Image Resizer to reduce input size before running this block for faster processing.

  • If the result looks noisy, try Denoising before applying this block, then compare with the original.

  • To preview results while building your flow, connect the output to Show Image.

  • If you only need a specific area enhanced, crop first with Image ROI and then apply this block.

  • Combine with Auto Contrast or Normalize Image to compare global vs local contrast enhancement and choose the best result for your application.

  • Save final images using Image Write or record multiple results with Image Logger.

πŸ› οΈ Troubleshooting

  • If images look oversaturated or noisy, reduce the Clip Limit or preprocess with Denoising.

  • If very small details disappear, increase the Grid Size to avoid overly local adjustments.

  • If processing is slow, reduce image size with Image Resizer before feeding into this block.

Last updated

Was this helpful?