Basic Mathematical Tools Used in Digital Image Processing... a Image acquisition using a linear sensor stripb Image acquisition using a circular sensor strip... Basic Mathematical Tools
Trang 1XỬ LÝ ẢNH TRONG CƠ ĐIỆN TỬ
Machine Vision
Giảng viên: TS Nguyễn Thành Hùng Đơn vị: Bộ môn Cơ điện tử, Viện Cơ khí
Hà Nội, 2021
Trang 21 Image Sensing and Acquisition
2 Image Sampling and Quantization
3 Some Basic Relationships Between Pixels
4 Basic Mathematical Tools Used in Digital Image Processing
Trang 3(a) Single sensing element
(b) Line sensor
(c) Array sensor
Trang 4Combining a single sensing element with mechanical motion to generate a 2-D image.
Trang 5(a) Image acquisition using a linear sensor strip
(b) Image acquisition using
a circular sensor strip
Trang 6An example of digital image acquisition (a) Illumination (energy) source (b) A scene (c) Imaging system (d) Projection of the scene onto the image plane (e) Digitized image.
Trang 7➢ We denote images by two-dimensional functions of the form f(x, y)
f(x, y) = i(x, y) r(x, y)
• i(x, y): the amount of source illumination incident on the scene being viewed
• r(x, y): the amount of illumination reflected by the objects in the scene
Trang 81 Image Sensing and Acquisition
2 Image Sampling and Quantization
3 Some Basic Relationships Between Pixels
4 Basic Mathematical Tools Used in Digital Image Processing
Trang 9➢ Digitizing the coordinate values is called sampling Digitizing the amplitude
values is called quantization.
(a) Continuous image (b) A scan line
showing intensity variations along line
AB in the continuous image (c)
Sampling and quantization (d) Digital
scan line (The black border in (a) is
included for clarity It is not part of the
image)
Trang 10(a) Continuous image projected onto a sensor array
(b) Result of image sampling and quantization
Trang 11(a) Image plotted as a surface (b) Image displayed as a visual intensity array (c) Image shown as a 2-D
numerical array (The numbers 0, 5, and 1 represent black, gray, and white, respectively.)
Trang 12Coordinate convention used to represent digital images
Because coordinate values are integers, there is a one-to-one
correspondence between x and
y and the rows (r) and columns
(c) of a matrix.
Trang 14➢ The number of intensity levels: L
where k is an integer.
➢ The discrete levels are equally spaced and that they are integers in the range
[0, L-1]
Trang 15➢ The number, b, of bits required to store a digital image is
➢ When M = N:
Number of megabytes required to store
images for various
values of N and k
Trang 16➢ coordinate indexing or subscript indexing (x, y) vs linear indexing ()
Illustration of column scanning for generating linear indices Shown are several
2-D coordinates (in parentheses) and their corresponding linear indices.
Trang 17➢ Spatial resolution is a measure of the
smallest discernible detail in an image.
➢ Dots per unit distance is a measure of
image resolution used in the printing and
publishing industry In the U.S., this
measure usually is expressed as dots per
inch (dpi)
➢ Intensity resolution is the number of bits
used to quantize intensity.
Effects of reducing spatial resolution The images shown are at: (a) 930 dpi, (b) 300 dpi, (c) 150 dpi, and (d) 72 dpi.
Trang 18(a) 256-level image (b)-(d) Image displayed in 128, 64, and 32 intensity levels, while keeping the image size constant (e)-(h) Image displayed in 16, 8, 4, and 2 intensity levels.
Trang 19(a) Image with a low level of detail (b) Image with a medium level of detail (c) Image with a relatively large amount of detail.
Trang 20➢ Observe that isopreference curves tend
to become more vertical as the detail in
the image increases
➢ This result suggests that for images with
a large amount of detail only a few
intensity levels may be needed.
Representative isopreferencecurves for the three types of images
Trang 21➢ Interpolation is the process of using known data to estimate values at unknown
locations
➢ Nearest neighbor interpolation
➢ Bilinear interpolation
➢ Bicubic interpolation
Trang 22(a) Image reduced to 72 dpi and zoomed back to its original 930 dpi using nearest neighbor interpolation (b) Image reduced to 72 dpi and zoomed using bilinear interpolation (c) Same as (b) but using bicubic interpolation.
Trang 231 Image Sensing and Acquisition
2 Image Sampling and Quantization
3 Some Basic Relationships Between Pixels
4 Basic Mathematical Tools Used in Digital Image Processing
Trang 24➢ A pixel p at coordinates (x, y)
➢ N4(p): 4-neighbors of p
➢ ND(p): 4 diagonal neighbors of p
➢ N8(p): N4(p) together with ND(p)
Trang 25➢ Let V be the set of intensity values used to define adjacency.
Trang 26➢ V = {1}
(a) An arrangement of pixels (b) Pixels that are 8-adjacent (adjacency is shown by dashed lines) (c)
m-adjacency (d) Two regions (of 1’s) that are 8-adjacent (e) The circled point is on the boundary of the 1-valued pixels only if 8-adjacency between the region and background is used (f) The inner boundary of the 1-valued
region does not form a closed path, but its outer boundary does
Trang 27➢ A digital path (or curve) from pixel p with coordinates (x0, y0) to pixel q with
coordinates (xn, yn) is a sequence of distinct pixels with coordinates:
➢ If (x0, y0) = (xn, yn) the path is a closed path
n is the length of the path
Trang 28Let S represent a subset of pixels in an image
➢ Two pixels p and q are said to be connected in S if there exists a path between
them consisting entirely of pixels in S.
➢ The set of pixels that are connected to p in S is called a connected component of
S.
➢ If it only has one component, and that component is connected, then S is called a
connected set.
Trang 29Let R represent a subset of pixels in an image
➢ We call R a region of the image if R is a connected set.
➢ Two regions, Ri and Rj are said to be adjacent if their union forms a connected
set.
➢ Regions that are not adjacent are said to be disjoint.
➢ Foreground: the union of all the K disjoint regions (Ru)
➢ Background: the complement of the set Ru: (Ru)c
Trang 30foreground
Trang 31➢ The boundary (also called the border or contour) of a region R is the set of pixels
in R that are adjacent to pixels in the complement of R.
intensity discontinuities closed paths
Trang 32➢ For pixels p, q, and s, with coordinates (x, y), (u, v), and (w, z), respectively, D is a
distance function or metric if:
Trang 33➢ The Euclidean distance between p and q is defined as:
The distance D4, (city-block distance) The distance D 8 , (chessboard distance)
Trang 341 Image Sensing and Acquisition
2 Image Sampling and Quantization
3 Some Basic Relationships Between Pixels
4 Basic Mathematical Tools Used in Digital Image Processing
Trang 35➢ An elementwise operation involving one or more images is carried out on a
pixel-by-pixel basis.
➢ The elementwise product of these two images is
➢ The matrix product of the images
Trang 36➢ Consider a general operator, H, that produces an output image, g(x, y), from a
given input image, f(x, y):
➢ H is said to be a linear operator if
➢ An operator that fails to satisfy above equation is said to be nonlinear.
Trang 37➢ Arithmetic operations between two images f(x, y) and g(x, y)
Trang 38(a) Sample noisy image of the
Sombrero Galaxy
(b)-(f) Result of averaging 10, 50,
100, 500, and 1,000 noisy images,
respectively All images are of size pixels, and all were scaled so that their intensities would span the full [0, 255] intensity scale
Trang 39(a) Infrared image of the Washington, D.C area (b) Image resulting from setting to zero the least significant
bit of every pixel in (a) (c) Difference of the two images, scaled to the range [0, 255] for clarity
Trang 42Set operations involving grayscale images (a) Original image (b) Image negative obtained using grayscale set complementation (c) The union of image (a) and a constant image.
Trang 44Illustration of logical operations involving foreground (white) pixels
Black represents binary 0’s and white binary 1’s
The dashed lines are shown for reference only
They are not part of the result
Trang 45(a) An 8-bit image (b) Intensity transformation function used to obtain the digital equivalent of a “photographic” negative of an 8-bit image The arrows show transformation of an arbitrary input intensity value into its
corresponding output value (c) Negative of (a), obtained using the transformation function in (b)
Trang 46Local averaging using neighborhood processing The procedure is illustrated in (a) and (b) for a rectangular neighborhood (c) An aortic angiogram (d) The result of using Eq (2) with m = m = 41 The images are of size
790 x 686 pixels
(2)
Trang 50(a) A 541 x 421 image of the letter T (b) Image rotated -210 using nearest-neighbor interpolation for intensity assignments (c) Image rotated -210 using bilinear
interpolation (d) Image rotated -210 using bicubic interpolation (e)-(h) Zoomed
sections (each square is one pixel, and the numbers shown are intensity values)
Trang 51(a) A digital image (b) Rotated image (note the counterclockwise direction for a positive angle of rotation) (c) Rotated image cropped to fit the same area as the original image (d) Image enlarged to accommodate the entire rotated image.
Trang 52Image registration (a) Reference image (b) Input (geometrically distorted image) Corresponding tie points are shown as small white squares near the corners (c) Registered (output) image (note the errors
in the border) (d) Difference between (a) and (c), showing more registration errors
Trang 53Forming a vector from corresponding pixel values in three RGB component images.
Trang 54➢ 2-D linear transforms
➢ Inverse transform
Trang 55General approach for working in the linear transform domain.
Trang 56(a) Image corrupted by sinusoidal interference (b) Magnitude of the Fourier transform showing the bursts of energy caused by the interference (the bursts were enlarged for display purposes) (c) Mask used to eliminate the energy bursts (d) Result of computing the inverse of the modified Fourier transform.