Contrast Maximization
Contrast Maximization identifies wavelengths or wavelength combinations that provide the strongest separation between two user-selected regions in a hyperspectral image.
Overview
Contrast Maximization identifies wavelengths or wavelength combinations that provide the strongest separation between two user-selected regions in a hyperspectral image.
The tool is designed to answer a practical hyperspectral imaging question:
Which wavelength, or combination of wavelengths, provides the best contrast between two regions of interest?
For example, the two regions may represent:
- Tissue and surrounding tissue
- Treated and untreated regions
Two analysis modes are available:
1. Individual Wavelength Contrast
2. Normalized Ratio Optimization
3. Choose the contrast mode.
4. Click Calculate Contrast.
5. Inspect the optimized image and contrast graph.
6. Review the Analysis Summary.
Click Select ROI 1 and draw a rectangular region on the image.
ROI 1 represents the first spectral population used in the comparison.
After the rectangle is created, it can be repositioned or resized before running the calculation.
The selected region should contain pixels representative of the first material, tissue, object, or spectral population of interest.
Click Select ROI 2 and draw the second rectangular region.
ROI 2 represents the comparison population.
For target-versus-background optimization, ROI 1 can represent the target and ROI 2 the background, or vice versa.
Because the contrast calculation uses the absolute difference between the two populations, reversing ROI 1 and ROI 2 does not change the magnitude of the calculated contrast.
For meaningful results, both ROIs should represent the populations that you intend to distinguish.
Avoid regions containing large numbers of unrelated pixels unless those mixed populations are intentionally part of the comparison.
Very small ROIs may produce unstable estimates because only a few pixels are used to calculate the mean and spectral variability.
Very heterogeneous ROIs can also reduce the calculated contrast because the within-region spectral variation becomes larger.
Whenever possible, select representative regions containing enough pixels to characterize each spectral population.
Uncheck Normalized ratio optimization to analyze each hyperspectral band independently.
IDCubePro calculates the contrast between ROI 1 and ROI 2 at every wavelength.
The wavelength producing the largest contrast value is identified automatically.
The corresponding hyperspectral band is then displayed in the Image / Optimized Contrast panel.
For each wavelength, IDCubePro compares the difference between the mean intensities of ROI 1 and ROI 2 relative to their spectral variability.
Conceptually, the contrast metric is:
Pooled within-ROI standard deviation The pooled standard deviation incorporates the variability present in both selected regions.
Therefore, a wavelength receives a high contrast score when:
- The mean signals of the two ROIs are substantially different, and
- The variability within the ROIs is relatively small.
This is useful because a large difference in mean intensity is less informative when the selected regions themselves have very large variability.
Contrast Across Wavelengths Graph
In Individual Wavelength mode, the Contrast Result panel displays contrast as a function of wavelength.
The highlighted point identifies the wavelength producing the maximum calculated contrast.
Peaks in this graph indicate spectral regions where ROI 1 and ROI 2 are most strongly separated.
The complete curve is often useful because several wavelength regions may provide good separation even when only one wavelength is mathematically optimal.
After Individual Wavelength analysis, the Image / Optimized Contrast panel displays the image acquired at the wavelength producing the maximum contrast score.
This allows direct visual inspection of whether the mathematically selected wavelength also provides useful spatial contrast.
The best numerical wavelength should therefore be interpreted together with the displayed image and the overall contrast spectrum.
Normalized Ratio Optimization
Enable Normalized ratio optimization to search for an optimal combination of two wavelengths.
Instead of evaluating one wavelength at a time, IDCubePro evaluates wavelength pairs using a normalized difference calculation.
For two wavelength images I1 and I2, the normalized-ratio image is calculated as:
IDCubePro evaluates this transformation for wavelength combinations across the hyperspectral dataset and determines which pair provides the greatest separation between ROI 1 and ROI 2.
Single-wavelength intensity can be affected by factors unrelated to the spectral property of interest.
- Overall reflectance or brightness
- Spatial variation in signal magnitude
Combining two wavelengths can sometimes reduce common intensity effects while emphasizing differences in spectral shape.
Normalized ratios are therefore widely useful for spectral contrast enhancement and index development.
Normalized-ratio Contrast Map
When Normalized ratio optimization is enabled, the Contrast Result panel displays a two-dimensional wavelength-pair map.
Each location in this map represents the contrast obtained from one wavelength combination.
One axis represents the first wavelength and the other axis represents the second wavelength.
The highlighted location identifies the wavelength pair producing the maximum contrast between the two selected ROIs.
Regions with higher contrast values indicate wavelength combinations that more strongly separate the two populations.
After the optimal wavelength pair is identified, IDCubePro generates the corresponding normalized-ratio image:
This optimized image is displayed in the Image / Optimized Contrast panel.
Positive and negative values indicate different relative relationships between the two selected wavelength signals.
The resulting image should be inspected visually to determine whether the optimized wavelength pair provides useful spatial discrimination.
INDIVIDUAL WAVELENGTH OR NORMALIZED RATIO?
Use this mode when you want to identify the single hyperspectral band that best separates two regions.
- Direct selection of an optimal imaging wavelength
- Useful for designing simplified single-band imaging systems
This is generally a good starting point for contrast analysis.
Use this mode when combinations of spectral bands may provide better discrimination than any individual wavelength.
- Can emphasize spectral-shape differences
- Can reduce common intensity effects
- Can identify useful two-band spectral indices
- May provide stronger target/background separation
Normalized-ratio optimization requires more computation because many wavelength combinations must be evaluated.
Interpreting The Contrast Value
A larger contrast value indicates stronger statistical separation between the two selected ROIs according to the contrast metric used by this tool.
The contrast value is not an absolute measure of biological, chemical, or material difference.
Contrast values should therefore primarily be used to compare wavelengths or wavelength combinations within the same analysis.
The Analysis Summary reports the main results of the calculation.
For Individual Wavelength mode, this includes:
For Normalized Ratio mode, the summary includes:
- Number of pixels in each ROI
- Ratio used to generate the displayed image
Click Reset to remove the current ROI selections and calculated results.
The original hyperspectral image preview is restored and a new analysis can be started.
Contrast optimization depends directly on the spectral data supplied to the tool.
Depending on the experiment, appropriate preprocessing may include:
- Reflectance or reference correction
- Removal of noisy wavelength regions
- Removal of saturated pixels
Preprocessing should be selected according to the imaging system and scientific objective.
Hyperspectral datasets often contain wavelength regions with low detector sensitivity or poor signal-to-noise ratio.
A noisy wavelength can occasionally produce an artificially large contrast value, particularly when the selected ROIs are small.
Always inspect the contrast curve and optimized image before accepting the maximum value as scientifically meaningful.
If the optimum occurs in a known noisy spectral region, consider removing that wavelength region during preprocessing and repeating the analysis.
For a new dataset, a useful workflow is:
1. Load and calibrate the hyperspectral dataset.
2. Apply appropriate preprocessing.
3. Open Contrast Maximization.
4. Select a representative ROI 1.
5. Select a representative ROI 2.
6. Begin with Individual Wavelength mode.
7. Click Calculate Contrast.
8. Inspect the complete contrast-versus-wavelength curve.
9. Inspect the optimized wavelength image.
10. Note the best wavelength and nearby high-contrast spectral regions.
11. Enable Normalized ratio optimization.
13. Inspect the wavelength-pair contrast map.
14. Inspect the optimized normalized-ratio image.
15. Compare the single-wavelength and normalized-ratio results.
Contrast Maximization can be useful for:
- Selecting optimal wavelengths for target detection
- Tissue/background discrimination
- Lesion/normal tissue comparison
- Vegetation and remote-sensing analysis
- Fluorescence or reflectance optimization
- Development of spectral indices
- Selection of bands for simplified multispectral systems
- Identification of informative spectral windows
The maximum contrast wavelength looks noisy The algorithm may have selected a wavelength with poor signal-to-noise characteristics. Inspect the raw spectrum and consider excluding noisy wavelength regions.
Contrast values are very low ROI 1 and ROI 2 may have similar spectral characteristics, or the within-region variability may be large. Inspect the ROI selections and underlying spectra.
The optimized image does not visually separate the regions A numerical maximum does not necessarily guarantee a visually useful image. Inspect neighboring wavelengths and the full contrast curve.
The result changes when the ROIs are moved This is expected. The optimization is based directly on the pixel populations contained within ROI 1 and ROI 2.
The result changes substantially with small ROI adjustments The selected regions may be heterogeneous or contain too few representative pixels. Consider using larger or more representative ROIs.
Normalized-ratio calculation takes longer This is expected because IDCubePro evaluates many wavelength combinations rather than analyzing each wavelength independently.
Single-band and normalized-ratio results are different This is expected. Single-band analysis optimizes one wavelength, whereas normalized-ratio analysis searches for complementary information contained in two wavelengths.
Important Interpretation Note
Contrast Maximization identifies wavelengths that statistically separate the two selected image regions.
It does not by itself identify the molecular, chemical, biological, or physical mechanism responsible for that difference.
Spectral interpretation should be supported by appropriate reference spectra, experimental controls, spectral libraries, known absorption features, or independent measurements when applicable.