Article Directory
2.1 Elements of visual perception
Perceived brightness is not a simple function of actual grayscale. Figure 2.7 Mach belt effect and Figure 2.8 are compared at the same time.
2.2 Light and the Electromagnetic Spectrum
The energy of an electromagnetic wave is proportional to the frequency, with higher frequency (shorter wavelength) electromagnetic waves carrying more energy per photon. Gamma rays have the highest energy and are very harmful to living tissues. Radio waves have the lowest energy.
Visible light spans the range 0.43 μm purple to 0.79 μm red.
In addition to frequency, colored light sources are described by 3 fundamental quantities: radiance, luminous flux (also called luminous intensity), and brightness.
2.3 Image perception and acquisition
Use single sensor, use strip sensor, use array sensor
2.4 Image Sampling and Quantization
2.4.1 Basic Concepts of Sampling and Quantization
Image sampling is the digitization of coordinate values. Image quantization is the digitization of amplitude values.
2.4.2 Digital Image Representation
Function graphics, visual grayscale matrix, two-dimensional numerical array.
2.4.4 Spatial resolution and grayscale resolution
Spatial Resolution: is a measure of the smallest discernible detail in an image
A widely used definition of image resolution is: the maximum number of line pairs that can be resolved per unit distance, or the number of points per unit distance.
Grayscale resolution refers to the smallest discernible change in grayscale.
2.4.5 Image interpolation
Interpolation is commonly used in tasks such as image enlargement, reduction, rotation, and geometric correction.
- Nearest Neighbor Interpolation: The grayscale of the nearest neighbor in the original image is assigned to each new position, which is the simplest but will cause serious straight-edge distortion.
- Bilinear interpolation: Using 4 nearest neighbor points to estimate the gray level of a given position can give much better results than nearest neighbor interpolation, but it is followed by an increase in the amount of calculation v ( x ,
y ) = ax + by + cxy + dv(x, y)=a x+b y+cx y+dv(x,y)=ax+by+cxy+d - Bicubic interpolation: with 16 nearest neighbor points, the complexity is higher, and it is better than bilinear interpolation in maintaining details. Coefficients are calculated from the surrounding 16 nearest neighbors.
v ( x , y ) = ∑ i = 0 3 ∑ j = 0 3 aijxiyjv(x, y)=\sum_{i=0}^{3} \sum_{j=0}^{3} a_{ij} x^{i} y^{j}v(x,y)=i=0∑3j=0∑3aijxiyj
2.5 Some basic relationships between pixels
Connectivity : make SSS is a subset of pixels in the image. IfSSTwo pixels ppin Sp andqqThere exists a completelySS between qThe path composed of pixels in S is calledppp andqqq inSSS is connected.
Region : Order RRR is a subset of pixels in the image. ifRRR is a connected set, calledRRR is a region. When talking about regions, 4-adjacency or 8-adjacency are generally considered. Adjacency type must be specified.
Region RRThe boundary of R , also called bounding box or contour isRRR withRRA set of pixels adjacent to pixels in the complement set of R.
Distance measure :
-
Euclidean distance D e D_eDe
D e ( p , q ) = [ ( x − u ) 2 + ( y − v ) 2 ] 1 2 D_{e}(p, q)=\left[(x-u)^{2}+(y-v)^{2}\right]^{\frac{1}{2}} De(p,q)=[(x−u)2+(y−v)2]21 -
City block distance D 4 D_4D4
D 4 ( p , q ) = ∣ x − u ∣ + ∣ y − v ∣ D_{4}(p, q)=|x-u|+|y-v| D4(p,q)=∣x−u∣+∣y−v∣
One can imagine a New York neighborhood where people can only walk around corners in a straight line.
- Board distance D 8 D_8D8
D 8 ( p , q ) = max ( ∣ x − u ∣ , ∣ y − v ∣ ) D_{8}(p, q)=\max (|x-u|,|y-v|) D8(p,q)=max(∣x−u∣,∣y−v∣)
2.6 Introduction to the basic mathematical tools used in digital image processing
2.6.3 Arithmetic operations
The General Method of Image Calibration and Its Programming Realization
g m = g − min ( g ) g_{m}=g-\min (g) gm=g−min(g)
It generates an image with a minimum value of 0. Then perform the operation:
g s = K [ g m / max ( g m ) ] g_{s}=K\left[g_{m} / \max \left(g_{m}\right)\right] gs=K[gm/max(gm)]
It generates a calibrated image with values in [ 0 , K ] [0, K][0,K ] range. When performing division operations, avoid dividing by 0. Note: When programming in MATLAB,+eps
.
f=imread('Pout.tif');
g=imadjus
t(f);
figure;
imshow(f);
figure; imhist(f);
figure; imshow(g); imwrite(g,
灰度扩展图像 .
figure; imhist(g);
2.6.4 Set operations and logic operations
Logical operations are widely used in image morphology processing.
2.6.5 Spatial operations
Single pixel operation, neighborhood operation, geometric transformation, image registration
Geometric transformations consist of two basic operations
-
Space Transformation of Coordinates
-
Grayscale interpolation, which is to assign grayscale values to pixels after spatial transformation
After the coordinate transformation of the rotated graphics, the new picture needs to be interpolated.
Image registration is used to align two or more images of the same scene.
2.6.7 Image transformation
In some cases, image processing is best done as follows: transform the input image, perform the specified task in the transformed domain, perform the inverse transformation, and return to the spatial domain.
2.6.8 Image grayscale and random variables
Image grayscale is treated as a random variable in many places in this book.
p ( z k ) = n k M N p\left(z_{k}\right)=\frac{n_{k}}{M N} p(zk)=MNnk
The mean (average) grayscale is:
m = ∑ k = 0 L − 1 zkp ( zk ) m=\sum_{k=0}^{L-1} z_{k} p\left(z_{k}\right )m=k=0∑L−1zkp(zk)
The variance of the grayscale is:
σ 2 = ∑ k = 0 L − 1 ( z k − m ) 2 p ( z k ) \sigma^{2}=\sum_{k=0}^{L-1}\left(z_{k}-m\right)^{2} p\left(z_{k}\right) p2=k=0∑L−1(zk−m)2p(zk)
It is a useful measure of image contrast.