Histogram and Its Transform: 2.1. Definition
Histogram and Its Transform: 2.1. Definition
1. The intensity of a gray image at any coordinates (x, y) is called gray level (brightness) a
of the image at that point. That is
a = f(x, y).
2. Let amin ≤ f(x, y) ≤ amax, for all (x,y): 1 ≤ x ≤ W-width of image, 1 ≤ y ≤ H-height
of image, then the interval [amin, amax] is called the gray scale.
3. A histogram, h[a], is the number of times that gray level a occurs in the image. The
height in this histogram corresponds to the number of pixels with a given brightness.
4. The histogram can be normalized so that the total area under the histogram is 1. Denote
p[a] for a brightness a:
p[a] := h[a] / Γ
Contrast is the range from the darkest regions of the image to the lightest regions. The
mathematical representation is
a − a min
contrast of image = max
a max + a min
where amax and amin are the maximum and minimum intensities of a region or image.
amax
amin
f ( x, y ) − a min
g ( x, y ) = L.
a max − a min
then, we have
0 ≤ g(x, y) ≤ L instead amin ≤ f(x, y) ≤ amax
0, f ( x, y) < al o w,
f ( x, y ) − a l o w
g ( x, y) = L. , al o w ≤ f ( x, y) ≤ ah i g ,h
ah i g h− al o w
L, a h i g h< f ( x, y)
In this second version might choose
Remark:
1) The requirement in (1) that T(r) be single valued is needed to
guarantee that the inverse transformation will exist, and the
monotonicity condition preserves the increasing order from
black to white in the output image.
−
a = T 1(b) for b ∈ [0, L-1]
2) Condition (2) guarantees that the output gray levels will be in
the same range as the input levels.
Let
p(a) = na / Γ
where
a –gray level in an immage
Γ – total number of pixels in the image
na –number of pixel with gray level a in the image
Define
T(a) = round ( L*{ p(0) + p(1) +...+ p(a-1) + p(a)} ),
we have: T(a) ∈ {0, 1, 2, ..., L-1, L}.
Then
g(x, y) = T( f (x, y))
for all x ∈[1,W], y ∈[1,H]
The negative of an image with gray level in the range [0, L] is obtained by using the negative
transformation
b = T(a),
where T(a) = L – a,
or
b=L–a
And hence
g(x, y) = L – f(x, y),
for all x ∈[1,W], y ∈[1,H]