Image Processing Reference
In-Depth Information
histogram(pic) := for bright 0..255
pixels - at - level bright
0
for x 0..cols(pic)-1
for y 0..rows(pic)-1
level pic y,x
pixels - at - level level
pixels - at - level level +1
pixels - at - level
Code 3.1
Evaluating the histogram
3.3
Point operators
3.3.1
Basic point operations
The most basic operations in image processing are point operations where each pixel value
is replaced with a new value obtained from the old one. If we want to increase the brightness
to stretch the contrast we can simply multiply all pixel values by a scalar, say by 2 to
double the range. Conversely, to reduce the contrast (though this is not usual) we can
divide all point values by a scalar. If the overall brightness is controlled by a level , l (e.g.
the brightness of global light), and the range is controlled by a gain , k , the brightness of the
points in a new picture, N , can be related to the brightness in old picture, O , by:
N x , y = k × O x , y + l x , y ∈ 1, N (3.1)
This is a point operator that replaces the brightness at points in the picture according to a
linear brightness relation. The level controls overall brightness and is the minimum value
of the output picture. The gain controls the contrast, or range, and if the gain is greater than
unity, the output range will be increased, this process is illustrated in Figure 3.2 . So the
image of the eye, processed by k = 1.2 and l = 10 will become brighter, Figure 3.2 (a), and
with better contrast, though in this case the brighter points are mostly set near to white
(255). These factors can be seen in its histogram, Figure 3.2 (b).
400
b_e ye_hist bright
200
0
0
100
200
Bright
(a) Image of brighter eye
(b) Histogram of brighter eye
Figure 3.2
Brightening an image
 
Search WWH ::




Custom Search