









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










The difference between this value and the entropy in (a) tells us that a mapping can be created to eliminate (1.811 − 1.25) = 0.56 bits/pixel of spatial redundancy.
To decode G ke x p ( n ):
d +
i ∑ − 1
j = 0
2 j^ + k^.
For example, to decode the first G (^) e x p^2 ( n ) code in the bit stream 10111011..., let i = 1, the number of 1s in a left-to-right scan of the bit stream before finding the first 0. Get the 2 + 1 = 3 bits following the 0, that is, 111 so d = 7. The decoded integer is then
7 +
j = 0
2 j^ +^2 = 7 + 22 = 11.
Repeat the process for the next code word, which begins with the bit sequence 011...
The arithmetic decoding process is the reverse of the encoding procedure. Start by dividing the [0, 1) interval according to the symbol probabilities. This is shown in Table P8.18. The decoder immediately knows the message 0. begins with an “e”, since the coded message lies in the interval [0.2, 0.5). This makes it clear that the second symbol is an “a”, which narrows the interval to [0.2, 0.26). To further see this, divide the interval [0.2, 0.5) according to the sym- bol probabilities. Proceeding like this, which is the same procedure used to code the message, we get “eaii!”.
Table P8. Symbol Probability Range a 0.2 [0.0, 0.2) e 0.3 [0.2, 0.5) i 0.1 [0.5, 0.6) o 0.2 [0.6, 0.8) u 0.1 [0.8, 0.9) ! 0.1 [0.9, 1.0)
The input to the LZW decoding algorithm in Example 8.7 is
The starting dictionary, to be consistent with the coding itself, contains 512 locations–with the first 256 corresponding to intensity values 0 through 255. The decoding algorithm begins by getting the first encoded value, outputting the corresponding value from the dictionary, and setting the “recognized sequence” to the first value. For each additional encoded value, we (1) output the dictio- nary entry for the pixel value(s), (2) add a new dictionary entry whose content is the “recognized sequence” plus the first element of the encoded value being processed, and (3) set the “recognized sequence” to the encoded value being processed. For the encoded output in Example 8.12, the sequence of operations is as shown in Table P8.20.
Note, for example, in row 5 of the table that the new dictionary entry for lo- cation 259 is 126-39, the concatenation of the currently recognized sequence, 126, and the first element of the encoded value being processed–the 39 from the 39-39 entry in dictionary location 256. The output is then read from the third column of the table to yield
where it is assumed that the decoder knows or is given the size of the image that was received. Note that the dictionary is generated as the decoding is carried out.
Inverse Mapper (e.g., DCT-1^ )
Inverse Quantizer
Variable Length Decoder
Decoded Image Macroblock
Variable Length Decoder
Motion Estimator and Compensator
Encoded Macroblock
Encoded Motion Vector
Figure P8.
The derivation proceeds by substituting the uniform probability function into Eqs. (8.2-57) - (8.2-59) and solving the resulting simultaneous equations with L = 4. Equation (8.2-58) yields
s 0 = 0 s 1 = 12 ( t 1 + t 2 ) s 2 = ∞.
Substituting these values into the integrals defined by Eq. (8.2-57), we get two equations. The first is (assuming s 1 ≤ A )
∫ (^) s 1
s 0
( s − t 1 ) p ( s ) d s = 0
∫ (^12) ( t 1 + t 2 )
0
( s − t 1 ) d s = s^2 2
− t 1 s
1 2 ( t^1 +^ t^2 ) 0
( t 1 + t 2 )^2 − 4 t 1 ( t 1 + t 2 ) = 0 ( t 1 + t 2 ) ( t 2 − 3 t 1 ) = 0
so
t 1 = − t 2 t 2 = 3 t 1.
The first of these relations does not make sense since both t 1 and t 2 must be pos- itive. The second relationship is a valid one. The second integral yields (noting that s 1 is less than A so the integral from A to ∞ is 0 by the definition of p ( s ))
∫ (^) s 2
s 1
( s − t 2 ) p ( s ) d s = 0
(^12) ( t 1 + t 2 )
( s − t 2 ) d s = s^2 2
− t 2 s
2 ( t^1 +^ t^2 )^
4 A^2 − 8 At 2 − ( t 1 + t 2 )^2 − 4 t 2 ( t 1 + t 2 ) = 0. Substituting t 2 = 3 t 1 from the first integral simplification into this result, we get
8 t (^) 12 − 6 At 1 + A^2 = 0 t 1 −
( 8 t 1 − 2 A ) = 0
t 1 =
t 1 =
Back substituting these values of t 1 , we find the corresponding t 2 and s 1 values:
t 2 = 32 A and s 1 = A for t 1 = A 2 t 2 = 34 A and s 1 = A 2 for t 1 = A 4.
Because s 1 = A is not a real solution (the second integral equation would then be evaluated from A to A , yielding 0 or no equation), the solution is given by the second. That is, s 0 = 0 s 1 = A 2 s 2 = ∞ t 1 = A 4 t 2 = 34 A.
A variety of methods for inserting invisible watermarks into the DFT coefficients of an image have been reported in the literature. Here is a simplified outline of one in which watermark insertion is done as follows:
Figure P8.
This is some blan text to move figure to top of page. This is some blan text to move figure to top of page. This is some blan text to move figure to top of page. This is some blan text to move figure to top of page. This is some blan text to move figure to top of page.
(a) With reference to the discussion in Section 2.5.2, m -connectivity is used to avoid multiple paths that are inherent in 8-connectivity. In one-pixel-thick, fully connected boundaries, these multiple paths manifest themselves in the four ba- sic patterns shown in Fig. P9.2(a). The solution to the problem is to use the hit- or-miss transform to detect the patterns and then to change the center pixel to 0, thus eliminating the multiple paths. A basic sequence of morphological steps to accomplish this is as follows:
X 1 = A B^1 Y 1 = A ∩ X c 1 X 2 = Y 1 B^2 Y 2 = Y 1 ∩ X c 2 X 3 = Y 2 B^3 Y 3 = Y 2 ∩ X c 3 X 4 = Y 3 B^4 Y 4 = Y 3 ∩ X c 4
where A is the input image containing the boundary.
(a) Erosion is set intersection. The intersection of two convex sets is convex also.
(b) See Fig. P9.4(a). Keep in mind that the digital sets in question are the larger black dots. The lines are shown for convenience in visualizing what the continu-
73
(a)
(b) (c)
(d) Figure P9.
The proof, which consists of showing that the expression
x ∈ Z^2 | ( B ) x ⊆ A
follows directly from the definition of translation because the set ( B ) x has ele- ments of the form x + b for b ∈ B. That is, x + b ∈ A for every b ∈ B implies that ( B ) x ⊆^ A. Conversely,^ ( B^ ) x ⊆^ A^ implies that^ all^ elements of^ ( B^ ) x are contained in A , or x + b ∈ A for every b ∈ B.
The approach is to prove that
( ˆ B ) x ∩ A =
x ∈ Z^2 | x = a + b for a ∈ A and b ∈ B
The elements of ( ˆ B ) x are of the form x − b for b ∈ B. The condition ( ˆ B ) x ∩ A = implies that for some b ∈ B , x − b ∈ A , or x − b = a for some a ∈ A (note in the preceding equation that x = a + b ). Conversely, if x = a + b for some a ∈ A and b ∈ B , then x − b = a or x − b ∈ A , which implies that ( ˆ B ) x ∩ A = .
Starting with the definition of closing, ( A • B ) c^ = [( A ⊕ B ) B ] c = ( A ⊕ B ) c^ ⊕ B ˆ = ( A c^ B ˆ ) ⊕ B ˆ = A c^ ◦ B ˆ. The proof of the other duality property follows a similar approach.
(a) Erosion of a set A by B is defined as the set of all values of translates, z , of B such that ( B ) z is contained in A. If the origin of B is contained in B , then the set of points describing the erosion is simply all the possible locations of the origin of B such that ( B ) z is contained in A. Then it follows from this interpretation (and the definition of erosion) that erosion of A by B is a subset of A. Similarly, dilation of a set C by B is the set of all locations of the origin of B ˆ such that the intersection of C and ( ˆ B ) z is not empty. If the origin of B is contained in B , this implies that C is a subset of the dilation of C by B. From Eq. (9.3-1), we know that A ◦ B = ( A B ) ⊕ B. Let C denote the erosion of A by B. It was already established that C is a subset of A. From the preceding discussion, we know also that C is a subset of the dilation of C by B. But C is a subset of A , so the opening of A by B (the erosion of A by B followed by a dilation of the result) is a subset of A.
It was possible to reconstruct the three large squares to their original size be- cause they were not completely eroded and the geometry of the objects and structuring element was the same (i.e., they were squares). This also would have been true if the objects and structuring elements were rectangular. However, a complete reconstruction, for instance, by dilating a rectangle that was partially eroded by a circle, would not be possible.
The key difference between the Lake and the other two features is that the for- mer forms a closed contour. Assuming that the shapes are processed one at a time, a basic two-step approach for differentiating between the three shapes is as follows:
nected components are labels with a value different from 1 or 0. The remaining black points are interior to spheres. We can fill all spheres with white by apply- ing the hole filling algorithm in Section 9.5.2 until all interior black points have been turned into white points. The alert student will realize that if the interior points are already known, they can all be turned simply into white points thus filling the spheres without having to do region filling as a separate procedure.
Denote the original image by A. Create an image of the same size as the origi- nal, but consisting of all 0’s, call it B. Choose an arbitrary point labeled 1 in A , call it p 1 , and apply the connected component algorithm. When the algorithm converges, a connected component has been detected. Label and copy into B the set of all points in A belonging to the connected components just found, set those points to 0 in A and call the modified image A 1. Choose an arbitrary point labeled 1 in A 1 , call it p 2 , and repeat the procedure just given. If there are K con- nected components in the original image, this procedure will result in an image consisting of all 0’s after K applications of the procedure just given. Image B will contain K labeled connected components.
Erosion is the set of points z such that B , translated by z , is contained in A. If B is a single point, this definition will be satisfied only by the points comprising A , so erosion of A by B is simply A. Similarly, dilation is the set of points z such that B^ ˆ ( B ˆ = B in this case), translated by z , overlaps A by at least one point. Because B is a single point, the only set of points that satisfy this definition is the set of points comprising A , so the dilation of A by B is A.
Consider first the case for n = 1:
E (^) G (^1 )( F ) =
F c^ ⊕ B ˆ
∩ G c^ c
=
F c^ ⊕ B
D ( G^1 c ) ( F c^ )
where the third step follows from DeMorgan’s law, ( A ∪ B ) c^ = A c^ ∩ B c^ , the fourth step follows from the duality property of erosion and dilation (see Section 9.2.3), the fifth step follows from the symmetry of the SE, and the last step follows from the definition of geodesic dilation. The next step, E ( G^2 )( F ), would involve the geodesic erosion of the above result. But that result is simply a set, so we could obtain it in terms of dilation. That is, we would complement the result just men- tioned, complement G , compute the geodesic dilation of size 1 of the two, and complement the result. Continuing in this manner we conclude that
E (^) G ( n ) = D ( G^1 c )
E (^) G ( n −^1 )( F )
D G (^1 ) c
D ( Gn c^ −^1 )
F c^
# c .
Similarly,
F c^ B ˆ
∪ G c^ c
=
F c^ B
E (^) G (^1 c ) ( F c^ )
.
As before,
D G ( n ) = E (^) G (^1 c )
D G ( n −^1 )( F )
E (^) G (^1 c )
E (^) G ( n c^ −^1 )
F c^
# c .
(a) Consider the case when n = 2
[( F 2 B )] c^ = [( F B ) B ] c = ( F B ) c^ ⊕ B ˆ =
F c^ ⊕ B ˆ
F c^ ⊕ 2 B ˆ