Skip to content

Color Optimization

Adrián José Riquelme Guill edited this page Sep 15, 2026 · 16 revisions

Normal Vector Colour Optimisation

The Normal Vector Colour Optimisation tool in DSE allows users to resolve visual colour discontinuities on subvertical planar structures (dip $\beta \approx 90^\circ$). By applying a temporary 3D rigid rotation matrix $R$ to the normal vectors prior to mapping them into a cylindrical colour space, this module eliminates boundary artefacts in stereographic projections and 3D point cloud visualisations without altering the geographic reference of the original structural data.


1. Accessing the Tool vs. Quick Export

It is important to distinguish between calculating the rotation matrix and applying/exporting the colour coding:

  1. Optimisation Module (Tools $\rightarrow$ Normal Colour Optimisation):

    • Opens the dedicated optimisation window.
    • Computes the optimal rigid rotation matrix $R$ via Genetic Algorithm.
    • Allows manual rotation angle adjustments, interactive plot generation (rotated colored poles and density stereograms), colour map previewing, and point cloud export to CloudCompare.
  2. Quick Export Button (Main GUI - Step 1):

    • Located in the 1. Principal poles tab, under Codificar 3DPC por color (Colour Wheel button).
    • Purpose: Performs a direct export/re-colouring of the point cloud into CloudCompare using the current colour space and rotation matrix (if previously calculated). It does not compute an optimized rotation matrix or open the configuration dialog.

dse-main-interface DSE Main Interface - Accessing Optimisation vs. Quick Export


2. Interface and Parameter Reference

The optimisation dialog is structured into parameter setup controls, a real-time colour map preview, a manual/calculated results panel, and an action toolbar.

dse-optimisation-dialog Normal Colour Optimisation Dialog Window

Optimisation Parameters

Parameter Description Recommended Value
Degrees of freedom Number of Euler angles $(\theta_1, \theta_2, \theta_3)$ used for the 3D rigid rotation matrix $R$. Select 3 for full spatial rotation. 3
Objective function Mathematical criterion used by the Genetic Algorithm to penalize poles located near the stereonet boundary ($\beta = 90^\circ$). rational_vertical_asymptote
Subsample (%) Percentage of normal vectors sampled from the point cloud to evaluate the objective function. Lower values speed up calculation. 10 – 25
Maximum generations Convergence limit for the Genetic Algorithm. 50 – 80
Population multiplier Multiplier defining total GA population size per generation relative to the problem dimension. 12
Random seed Integer seed for pseudorandom number generation. Leave blank for stochastic runs or specify an integer for reproducible results. Blank
Colour space Target color space for vector projection (HSV, CIELAB, CIELCH, CIELCHMod, OKLCH, or HSLuv). CIELCHMod / OKLCH
Value / lightness (0-100) Radial saturation limit percentage ($P$) or target lightness level ($L^*$). 75 – 80

3. Detailed Description of Available Colour Spaces

DSE projects normal vectors onto a lower-hemisphere stereographic projection overlaid with a polar grid (Riquelme stereonet overlay / falsilla):

  • Azimuth / Dip Direction ($\alpha \in [0^\circ, 360^\circ]$): Derived from polar coordinate angle $h = \text{arctan2}(y, x)$.
  • Dip Angle ($\beta \in [0^\circ, 90^\circ]$): Derived from radial distance $r = \sqrt{x^2 + y^2} \in [0, 1]$, where $r = \beta / 90^\circ$.

Comparison of available cylindrical colour spaces Comparison of available cylindrical colour spaces projected onto stereographic polar grids: HSV, CIELAB, CIELCH, CIELCHMod, OKLCH, and HSLuv.

(a) HSV (Hue, Saturation, Value)

  • Overview: Standard cylindrical coordinate model derived from sRGB color space.
  • Mathematical Formulation:
    • Hue ($H$): $H = h / (2\pi) \in [0, 1]$
    • Saturation ($S$): $S = r \in [0, 1]$
    • Value ($V$): $V = \text{GUI Lightness} / 100.0$
  • Characteristics: Computationally trivial and fast, but perceptually highly non-uniform. Human vision naturally perceives pure yellows and greens as significantly brighter than pure blues, introducing artificial brightness highlights across orientation data.

(b) CIELAB (CIE $L^*a^b^$)

  • Overview: Perceptually uniform $L^*a^b^$ colour space established by the CIE in 1976.
  • Mathematical Formulation:
    • Lightness ($L^*$): $L^* = \text{GUI Lightness}$
    • Chroma ($C^*$): $C^* = 100.0 \cdot r$
    • Chromatic Coordinates: $a^* = C^* \cos(h)$, $b^* = C^* \sin(h)$
  • Characteristics: Transforms Cartesian coordinate offsets directly to chromatic axes. To handle out-of-gamut values outside physical sRGB limits, DSE performs binary-search gamut mapping that reduces chroma while strictly preserving lightness and hue angle.

(c) CIELCH (CIE $L^*C^*h^\circ$)

  • Overview: Cylindrical polar representation of CIELAB decoupling orientation into Hue angle and Chroma.
  • Mathematical Formulation:
    • Lightness ($L^*$): $L^* = \text{GUI Lightness}$
    • Chroma ($C^*$): $C^* = 85.0 \cdot r$
    • Hue Angle ($h$): $h = \text{arctan2}(y, x)$
  • Characteristics: Maximum chroma is scaled to $85.0$ to avoid aggressive gamut clipping on saturated primaries, providing a predictable linear progression from center to disk edge.

(d) CIELCHMod (Modified CIELCH)

  • Overview: Custom color space designed specifically for structural geology in DSE to maximize visual contrast on steep-to-subvertical joint sets ($\beta > 70^\circ$).
  • Mathematical Formulation:
    • Chroma ($C^*$): $C^* = 100.0 \cdot r$
    • Hue Angle ($h$): $h = \text{arctan2}(y, x)$
    • Variable Lightness ($L^*$): $$L^*(r) = 50.0 + r \cdot (\text{GUI Lightness} - 50.0)$$
  • Operational Effect: Lightness scales dynamically from a neutral grey ($L^*=50.0$) at the center pole ($r=0$) to the target lightness level at the outer circle boundary ($r=1$). This provides high contrast for steep subvertical planes while maintaining uniform chroma scaling.

(e) OKLCH

  • Overview: Polar representation of the modern Oklab perceptual color space (Ottosson, 2020).
  • Mathematical Formulation:
    • Lightness ($L$): $L = \text{GUI Lightness} / 100.0$
    • Chroma ($C$): $C = 0.38 \cdot r$
    • Hue Angle ($h$): $h = \text{arctan2}(y, x)$
  • Characteristics: State-of-the-art perceptual uniformity. Unlike CIELAB, OKLCH completely eliminates hue-shift artifacts (such as blue shifting towards purple as chroma increases), making it the gold standard for high-precision scientific figures.

(f) HSLuv

  • Overview: Perceptual adaptation of HSL constructed over CIELCH with normalized display gamut boundaries.
  • Mathematical Formulation:
    • Lightness ($L^*$): $L^* = \text{GUI Lightness}$
    • Normalized Saturation ($S$): $S = r \in [0, 1]$
    • Chroma Scaling: Evaluates maximum reachable gamut boundary $C_{\max}(h, L^)$ per hue direction via binary search, then sets $C(r, h) = r \cdot C_{\max}(h, L^)$.
  • Characteristics: Prevents abrupt color saturation clipping at monitor boundaries, ensuring smooth, even contrast transitions regardless of hue direction.

Summary Comparison Table

Space Label Perceptual Uniformity Chroma Formulation ($C$) Lightness Handling ($L^*$) Primary Application in DSE
HSV (a) Low $S = r$ Constant ($V = \text{GUI}/100$) Legacy / fast preview
CIELAB (b) High $C^* = 100 \cdot r$ Constant ($L^* = \text{GUI}$) Cartesian chromatic analysis
CIELCH (c) High $C^* = 85 \cdot r$ Constant ($L^* = \text{GUI}$) Standard polar projection
CIELCHMod (d) High $C^* = 100 \cdot r$ Dynamic ($50 \to \text{GUI}$) Default choice for steep joints
OKLCH (e) Excellent $C = 0.38 \cdot r$ Constant ($L = \text{GUI}/100$) High-precision publication figures
HSLuv (f) High $C = r \cdot C_{\max}(h, L^*)$ Constant ($L^* = \text{GUI}$) Screen-consistent display without clipping

4. Optimisation Results & Manual Angle Editing

  • Calculated Angles Panel: Displays the Euler rotation angles $(\theta_1, \theta_2, \theta_3)$ in degrees ($^\circ$) and the resulting Objective value.
  • Manual Editing: Users can directly type or edit custom rotation angles into the input fields and click Apply angles to evaluate specific rotations without running the Genetic Algorithm.

Action Toolbar (Bottom Controls)

Icon / Button Action Description
1. Compute Run Optimisation Executes the Genetic Algorithm to search for optimal Euler rotation angles.
2. Rotated Colored Poles Plot Rotated Poles Displays a stereonet of rotated poles rendered with their mapped colours overlaid with the Riquelme grid. (Note: Axes labels are omitted because rotated stereograms represent relative geometry rather than absolute geographic orientations).
3. Rotated Density Plot Rotated Density Displays density contours of the rotated poles on a stereonet without geographic coordinate labels.
4. Export Export Coloured Cloud to CC Applies the current colour mapping and exports/updates the coloured point cloud in CloudCompare.

5. Mathematical Background

When mapping normal vectors to colour spaces based on dip direction and dip angle, subvertical discontinuities often split across opposite edges of the projection circle due to noise and surface roughness. This produces artificial, high-contrast colour jumps across continuous planar faces.

Objective Functions

The tool optimizes Euler rotation angles to minimize one of the following penalty formulations:

  1. Rational Function with Asymptote at 91° (Recommended): Imposes an asymptotic penalty as pole dips approach $90^\circ$, shifting the mathematical singularity to $91^\circ$ for numerical stability:

    $$OF = \sum_{i=1}^{N} \left[ \frac{1}{91^\circ - \beta_i} - \frac{1}{91^\circ} \right]$$

  2. Potential Functions (Linear / Quadratic / Cubic): Penalizes steep dips based on power laws weighted by pole density $d_i$:

    $$OF = \frac{\sum_{i=1}^{N} (\beta_i^k \cdot d_i)}{\sum_{i=1}^{N} d_i} \quad \text{where } k=1 \text{ (Linear)}, k=2 \text{ (Quadratic)}, \text{ or } k=3 \text{ (Cubic)}$$

Gamut Mapping Strategy

When converting polar coordinates to perceptual colour spaces (CIELAB, CIELCH, OKLCH, HSLuv), requested chromas frequently exceed the sRGB display gamut. DSE utilizes a binary-search gamut mapper (12 to 14 iterations) that preserves lightness $L^*$ and hue $h$ while scaling chroma $C$ to guarantee output RGB values remain within $[0, 1]$.


6. Workflow Step-by-Step

  1. Open the Optimiser: Navigate to Tools $\rightarrow$ Normal Colour Optimisation.
  2. Configure Parameters:
    • Set Degrees of freedom to 3.
    • Choose an Objective function (rational_vertical_asymptote).
    • Select the target Colour space (CIELCHMod or OKLCH).
    • Adjust Subsample (%) (10% to 25%).
  3. Run Optimization or Set Manual Angles:
    • Click Compute (first toolbar button) to find optimal rotation angles via Genetic Algorithm.
    • Alternatively: Manually type known rotation angles into the numerical input fields.
  4. Inspect Results:
    • Review the real-time Colour space preview map overlaid with the Riquelme grid.
    • Click Rotated Colored Poles or Rotated Density to inspect the rotated stereograms.
  5. Export to CloudCompare: Click the Export button (fourth toolbar icon) to transfer the coloured point cloud directly to CloudCompare.

🔗 Next Steps


📚 References

  • Jaboyedoff, M., Metzger, R., Oppikofer, T., Couture, R., Derron, M. H., Locat, J., & Turmel, D. (2007). New insight techniques to analyze rock-slope relief using DEM and 3D imaging cloud points: COLTOP-3D software. In 1st Canada-US Rock Mechanics Symposium. ARMA.
  • Riquelme, A. J., et al. (2025). Optimisation of 3D point cloud colour mapping based on normal vector orientations. Journal of Rock Mechanics and Geotechnical Engineering. https://doi.org/10.1016/j.jrmge.2025.12.059
  • Riquelme, A. J., Abellán, A., Tomás, R., & Jaboyedoff, M. (2014). A new approach for semi-automatic rock mass joints recognition from 3D point clouds. Computers & Geosciences, 68, 38–52. https://doi.org/10.1016/j.cageo.2014.03.014
📋 View full bibliographic entries and BibTeX

1. Jaboyedoff et al. (2007)

Field Details
Authors Michel Jaboyedoff, R. Metzger, Thierry Oppikofer, R. Couture, Marc-Henri Derron, Jacques Locat, D. Turmel
Title New insight techniques to analyze rock-slope relief using DEM and 3D imaging cloud points: COLTOP-3D software
Booktitle / Event 1st Canada-US Rock Mechanics Symposium (ARMA)
Publication Year 2007
Publisher American Rock Mechanics Association (ARMA)
Paper Code ARMA-07-227
@inproceedings{Jaboyedoff2007,
  author    = {Jaboyedoff, Michel and Metzger, R. and Oppikofer, Thierry and Couture, R. and Derron, Marc-Henri and Locat, Jacques and Turmel, D.},
  title     = {New insight techniques to analyze rock-slope relief using DEM and 3D imaging cloud points: COLTOP-3D software},
  booktitle = {1st Canada-US Rock Mechanics Symposium},
  year      = {2007},
  publisher = {American Rock Mechanics Association},
  note      = {ARMA-07-227}
}

2. Riquelme et al. (2025)

Field Details
Authors Adrián J. Riquelme et al.
Title Optimisation of 3D point cloud colour mapping based on normal vector orientations
Journal Journal of Rock Mechanics and Geotechnical Engineering
Publication Year 2025
DOI 10.1016/j.jrmge.2025.12.059
@article{Riquelme2025,
  author  = {Riquelme, A. J. and others},
  title   = {Optimisation of 3D point cloud colour mapping based on normal vector orientations},
  journal = {Journal of Rock Mechanics and Geotechnical Engineering},
  year    = {2025},
  doi     = {10.1016/j.jrmge.2025.12.059}
}

Clone this wiki locally