|
Algorithm 1 HybridAugment+ |
|
Require: Image (RGB photograph or grayscale radiograph), parameters = 2, = 10, = 2, = 9, Minimal constant
|
|
Ensure: Augmented image
|
|
/* Step 1: Contrast enhancement */
|
| 1: if is RGB photograph then
|
| 2: /* Convert to grayscale */
|
| 3: else
|
| 4: = /* Radiograph already grayscale */
|
| 5: end if
|
| 6: /* Local contrast enhancement */
|
| 0/* Step 2: Color balancing (photographs only) */
|
| 7: /*Identify bit-depth */
|
| 8:
|
| 9: if is RGB photograph then
|
| 10: /*Reduce illumination bias */
|
| 11: /*Compute pixel-wise gain */
|
| 12: /*Apply gain to all channels */
|
| 13: else
|
| 14:
|
| 15: end if
|
|
0/* Step 3: Entropy computation */
|
| 16: Compute histogram from for i = 0, …, – 1 |
| 17: /*Shannon entropy in bits */
|
| 18: /*Normalize by maximum entropy */
|
| /* Step 4: Adaptive operation count selection */ |
| 19: /*Expected operation count */
|
| 20: /*Stochastic sampling */
|
| 21: /*Discrete operation count*/
|
| /* Step 5: RandAugment with modality-specific operations */ |
| 22:
/*Pool selected based on modality/*
|
|
/*Step 6: Color preservation (photographs only) */
|
| 23: if is RGB photograph then
|
| 24: /*Mild gamut mapping/*
|
| 25: end if
|
| 26: return
|