Documentation  ›  Documentation Library  ›  Contrast Enhancement
Filtering & Corrections

Contrast Enhancement

IDCubePro 2026 - Contrast Enhancement Help

Overview

Close Contrast Enhancement help.

Idcubepro 2026 - Contrast Enhancement

Purpose

The Contrast Enhancement module contains several operations that improve image contrast or compensate for spatial nonuniformity in the current hyperspectral datacube.

The available operations are Image Adjustment, Histogram Equalization, CLAHE, Flat-Field Correction, and Reset Contrast Enhancement.

Important Scientific Distinction

Image Adjustment, Histogram Equalization, and CLAHE are intensity-transforming enhancement methods. They can improve visualization, but they also change numerical intensity relationships.

Flat-Field Correction addresses spatial nonuniformity using a selected reference region and has a different purpose from histogram-based contrast enhancement.

These operations modify the current working cube stored in myData.Images. The original dataset in myDataOriginal is preserved when available so that Reset Contrast Enhancement can restore it.

IDCubePro records the applied contrast operation and resulting cube dimensions in processing history when the history system is available.

Do not apply contrast enhancement automatically to every dataset. Choose the method according to the problem you are trying to solve and inspect the result before quantitative analysis or machine learning.

Each spectral band is independently converted to double precision, rescaled, and processed with MATLAB imadjust.

Because every band is treated separately, the transformation optimizes the intensity distribution of each wavelength image rather than applying one global transformation to the entire cube.

Use Image Adjustment when a band has poor visible contrast because useful intensities occupy only part of the available display range.

It is especially useful for exploratory visualization, feature inspection, segmentation preparation, and creating clearer band images.

Do not assume that an imadjust-processed cube preserves original quantitative spectral relationships.

Independent band-wise rescaling can change relative amplitudes between wavelengths. This can be undesirable for spectroscopy, concentration estimation, spectral ratios, quantitative unmixing, or models that depend on physically meaningful intensity relationships.

Inspect representative bands before and after processing. Useful structures should become easier to distinguish without producing excessive saturation or loss of subtle features.

For quantitative work, compare results against analysis performed on the original or physically calibrated data.

Use this as a visualization-oriented enhancement unless your downstream method has been explicitly validated using the transformed data.

Each spectral band is independently rescaled and processed with global histogram equalization using MATLAB histeq.

Histogram equalization redistributes image intensities so that the available intensity range is used more broadly.

Use global histogram equalization when contrast is weak across an entire band and the important structures are distributed broadly over the image.

It can reveal structures that are difficult to see when most pixels occupy a narrow intensity range.

The transformation is global. A histogram dominated by one large region can determine the mapping for the whole image.

It can also exaggerate noise or small intensity differences that are not scientifically meaningful.

Histogram equalization changes the intensity distribution substantially and should normally be considered an enhancement operation rather than a physically quantitative correction.

Check whether structures of interest become clearer across the full image. Look for washed-out regions, excessive contrast, amplified noise, or artificial-looking boundaries.

Choosing Between Histeq And Clahe

Start with Histogram Equalization when the contrast problem is approximately global. Use CLAHE when different parts of the image require different local contrast enhancement.

Clahe - Contrast-limited Adaptive Histogram Equalization

CLAHE is applied independently to every spectral band using MATLAB adapthisteq.

Unlike global histogram equalization, CLAHE works locally. The image is divided into neighborhoods and local intensity distributions are enhanced while contrast limiting reduces extreme amplification.

Use CLAHE when illumination or contrast varies across the field of view and important local structures are difficult to distinguish with a single global mapping.

It is often useful for revealing local texture, edges, weak structures, or spatially heterogeneous features.

Why Contrast Limiting Matters

Pure adaptive histogram equalization can strongly amplify noise. CLAHE limits local contrast amplification and is therefore generally more controlled.

CLAHE can still amplify detector noise, shot noise, compression artifacts, or low-SNR structure, especially in weak spectral bands.

CLAHE changes local intensity relationships. Treat it primarily as an enhancement or image-processing transformation unless the downstream quantitative method has been validated with CLAHE preprocessing.

Inspect high-SNR and low-SNR bands. Confirm that real structures are enhanced without creating granular texture, false boundaries, or strong noise amplification.

Choosing Between Clahe And Histeq

Use Histogram Equalization for a global contrast problem. Use CLAHE when the contrast problem varies spatially.

Purpose

Flat-field correction is intended to reduce spatial nonuniformity caused by illumination variation, detector response, vignetting, or related field-dependent effects.

This is conceptually different from simply making an image look more contrasted.

Workflow

1. Start Flat-Field Correction.

2. Select a reasonably uniform reference region in the displayed image.

3. Double-click the ROI to confirm.

4. IDCubePro applies flat-field correction to the full hyperspectral cube.

The selected ROI should represent the illumination or detector response that you want to normalize.

Choose a region that is as spatially uniform as possible and avoid strong targets, edges, shadows, saturated pixels, glare, dead pixels, or obvious sample structures.

A very small ROI may be dominated by noise or local defects. A larger homogeneous ROI is usually more representative, but it should not be expanded into heterogeneous regions simply to increase pixel count.

Flat-field correction assumes that the selected region provides meaningful information about spatial response or illumination nonuniformity.

If the selected region contains genuine sample variation, that variation can be incorporated into the correction and may create artifacts.

Use flat-field correction when the same type of object or material appears systematically brighter in one part of the field than another because of the imaging system rather than the specimen.

Do not use flat-field correction merely because the image has low contrast. Low contrast and spatial response nonuniformity are different problems.

Inspect spatially uniform regions before and after correction. A successful correction should reduce broad illumination gradients without removing genuine structures or introducing edge artifacts.

Inspect several wavelengths, not only the currently displayed image. Spatial nonuniformity and correction behavior can differ across spectral bands.

Reset restores the original dataset from myDataOriginal when that original copy is available.

It also clears the working contrast-enhancement state and refreshes the current IDCubePro display.

Use Reset when you want to discard the current contrast-enhanced working cube and return to the original loaded data.

Important

Reset is not an inverse mathematical transformation of CLAHE, histogram equalization, or imadjust. Instead, it restores the preserved original cube.

If myDataOriginal is unavailable or was replaced by another workflow, the original dataset cannot be reconstructed from the contrast-enhanced cube by this command.

When comparing several enhancement methods, return to the original data before applying a different method if you want a fair comparison.

Applying multiple nonlinear contrast methods sequentially produces a different result from applying each method independently to the original cube.

Band-wise rescale followed by imadjust. Best regarded primarily as a global band-wise visualization enhancement.

Band-wise global histogram redistribution. Useful when the overall image has weak global contrast.

Band-wise local adaptive histogram equalization with contrast limiting. Useful when contrast varies spatially.

Uses a selected uniform reference ROI to compensate for spatial illumination or detector nonuniformity.

5. Reset Contrast Enhancement

Restores the preserved original cube when myDataOriginal is available.

WHICH METHOD SHOULD I CHOOSE?

If the problem is simply weak global display contrast, try Image Adjustment first.

If the intensity histogram is strongly compressed and a more aggressive global redistribution is useful, try Histogram Equalization.

If contrast varies from region to region, CLAHE is usually more appropriate than global histogram equalization.

If the problem is a broad spatial illumination or detector-response gradient, use Flat-Field Correction rather than histogram enhancement.

If you are uncertain whether enhancement is helping, compare against the original cube using Reset.

For Quantitative Spectroscopy

Be conservative with Image Adjustment, Histogram Equalization, and CLAHE because they alter numerical intensities. Physical calibration, reference correction, baseline correction, normalization, or other spectroscopy-specific preprocessing may be more appropriate depending on the measurement problem.

Contrast enhancement can sometimes improve spatial feature visibility, but it can also alter class distributions or create preprocessing-dependent features.

Fit and validate the complete preprocessing pipeline consistently. Do not process training and test data differently.

Record which operation was applied and ensure the same preprocessing is used across datasets that will be compared.

Always inspect multiple bands and representative spectra after preprocessing. A visually attractive image is not by itself evidence that a transformation is scientifically appropriate.