SME
Remote Sensing
Image processing
Use this for “An image’s values run from 40 to 120. After a linear stretch to 0–255, what does a pixel of 70 become?”
Chart
DN′(70) = 95.625
This is an example. Type your own values to start a new problem.
DN
Pixel value
example
DNₘᵢₙ
Image minimum
example
DNₘₐₓ
Image maximum
example
g
Stretch gain
worked out (not typed)
DN′
Stretched value
calculated
L
Display level
worked out (not typed)
Formulas
g
=
255
DNₘₐₓ − DNₘᵢₙ
3.1875
=
255
120 − 40
DN′
=
255
×
DN − DNₘᵢₙ
DNₘₐₓ − DNₘᵢₙ
95.625
=
255
×
70 − 40
120 − 40
L
=
DN′
rounded
to
the
ones
96 = 95.625 rounded to the ones
Assumptions
•
An 8-bit display shows whole levels 0 to 255; the stretch maps the image minimum to 0 and its maximum to 255.
•
Values below the minimum or above the maximum saturate at 0 or 255, so they can’t be undone.
•
The stretch changes only how the image looks; the stored values used for measurements stay the same.
Step-by-step
WE KNOW
DN = 70, DNₘᵢₙ = 40, DNₘₐₓ = 120
FIND
stretch gain (g), stretched value (DN′), display level (L)
Step 1 · Find stretch gain (g)
Use g = 255 ÷ (DNₘₐₓ − DNₘᵢₙ)
The
image’s
range
is
spread
over
the
display’s
255
steps:
each
step
of
DN
becomes
g
steps.
g
=
255
120 − 40
g
=
255
80
g
=
3.1875
Step 2 · Find stretched value (DN′)
Use DN′ = 255 × (DN − DNₘᵢₙ) ÷ (DNₘₐₓ − DNₘᵢₙ)
The pixel’s distance above the minimum, as a share of the range, times 255.
40 ≤ 70 ≤ 120: inside the image’s range
DN′
=
255
×
70 − 40
120 − 40
255 × (70 − 40) = 7,650
7,650
80
=
95.63
DN′ = 95.625
Step 3 · Find display level (L)
Use L = DN′ rounded to the ones
The display shows whole levels only, so round the stretched value.
L
=
95.625
rounded
to
the
ones
L
=
96
Check
Put the numbers back in. Both sides should match.
3.1875
=
255
120 − 40
✓
95.625
=
255
×
70 − 40
120 − 40
✓
96 = 95.625 rounded to the ones ✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
More problem types
Radiance and reflectance from DN
Use this for “A pixel reads 100 with gain 0.8 and offset −1.5. ESUN is 1,550, the Sun is 35° from overhead and Earth is 1 AU away. What are its radiance and reflectance?”
NDVI of a pixel
Use this for “A pixel reflects 0.45 of near-infrared light and 0.08 of red light. What is its NDVI?”